Warning: excessive nitpicking ahead.

Ashley Winters skribis 2004-12-08 10:51 (-0800):
>     rule year { \d<4> }

    \d**{4}

Or, well, \d**{2,4}

>     rule month { \d<2> }

    \d**{2}

>     rule date { <year> -? <month> -? <day> }

    rule week { \d**{2} }
    rule yday { \d**{3} }
    rule date {
        <year> 
        [
            -? 
            [ 
                <yday> 
            |
                [ [ W<week> | <month> ] [ -? <day> ]? ] 
            ]
        ]?
    }  # :)

>     rule time { <hour> \:? <minute> \:? <second> [\. <fraction>]? }

Likewise making parts optional, and "." can also be ",".


>     rule datetime { <date> T <time> }

    rule timezone { Z | <[+-]> <hour> [ \:? <minute> ]? }

    rule datetime { <date> [ T <time> <timezone>? ]? }


And still this isn't a full ISO8601 grammar. But I it now covers every
notation that I have seen in the wild so far. A useful source of
information, apart from the ISO standard itself, is
DateTime-Format-ISO8601.


Juerd

Reply via email to