Hi Karl,
Karl Fogel writes:
>"Mark D. Baushke" <mdb@juniper.net> writes:
>> They point to the paper http://www.cl.cam.ac.uk/~mgk25/iso-time.html
>> by Markus Kuhn which is really a good summary.
>>
>> It is good to note that the 'T' is recommended when you need to store
>> a time and is not required when you are just displaying a time.
>
>This paper repeats the assertion that the 'T' is a good idea, but
>doesn't give any reasons *why* this might be so :-).
Yeah, I know. I would guess that the original motivation was to have a
single token that represents time so you do not need to heuristically
determine when to stop parsing the time string.
Consider a data line like the following. You need to parse the leading
timestamp and then save the following token for extra processing as well
as remember the comment that follows:
20020622T225002+03 -22 some arbitrary comment, -22 is data
20020622T225002+0300 -22 some arbitrary comment, -22 is data
2002-06-22T22:50:02+03:00 -22 some arbitrary comment, -22 is data
2002-06-22T19:50:02Z -22 some arbitrary comment, -22 is data
2002-06-22 09:50:02 -10:00 -22 some arbitrary comment, -22 is data
2002-06-22 09:50 -10:00 -22 some arbitrary comment, -22 is data
2002-06-22 09:50 -10 -22 some arbitrary comment, -22 is data
2002-06-22 09 -10 -22 some arbitrary comment, -22 is data
2002-06-22 09 -22 some arbitrary comment 09am local time -22 is data
20020622 095002 -22 some arbitrary comment, 09:50am local time, -22 is data
20020622 095002 -10 -22 some arbitrary comment, -22 is data
20020622 095002 -1000 -22 some arbitrary comment, -22 is data
20020622 195002Z -1000 -22 some arbitrary comment, -1000 is data
20020622 -1000 -22 some arbitrary comment, -1000 is data
2002-06-22 19Z -22 some arbitrary comment
20020622 195002Z -10 -22 some arbitrary comment -10 is data
In the first four cases, it is trivial to parse the time
followed by the -22 followed by the arbitrary comment.
In the subsequent cases, it is less obvious to figure out what is
happening...
>> The W3 Consortium also talked about ISO-8601 timeszones
>> (see URL<http://www.w3.org/TR/NOTE-datetime>).
>
>This paper also tells the reader to "note the T", but also doesn't
>explain why T is preferable to a space.
Yup.
>I wish I understood the motivation for the T better. It doesn't make
>the date string any more automatically parseable than a space would,
>but does make it less readable to the eye. What's the use?
Well, if you have a number of tokens on a line and you know that one of
them is time and the one after time is <something> it may be easier if
the <something> could be mistaken for a time fragment to have the entire
time token as one unambiguous blob.
>Something of a bikeshed <shrug>. But if we can just use one stringy
>time format, for both storage and human presentation, that's a win.
Agreed, but it is likely to be a matter of context and knowing
unambiguously what is part of the time string and what is part of other
data that surrounds it.
Enjoy!
-- Mark
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sat Jun 22 22:09:48 2002