[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: date format



Alan Barrett wrote:
> > The ISO date format "yyyy-mm-dd hh:mm:ss" is valid for another 9000 
> > years.
> 
> Yes, please use that format.  And if you permit 5, 6, 7... digit 
> years, then it has no built in obsolescence at all.

Unfortunately you have to stick to four digit years, with leading zeros,
for ASCII sort to work.  Here's an example that's sorted ASCII:

10000-10
1997-10
19970-10

As to the discussion about seconds - if we express the date as a
byte-string, it can be of arbitrary length.  With ASCII sort, this works as
expected when you add decimals to the second:

10:20:00
10:20:00.300
10:20:00.40
10:20:00.5

Incidentally, this happens to be the ISO format. (correct me if I'm
wrong.)  There are some slight parsing drawbacks, so I think we should
consider this format only if someone sees a clear need for resolution less
than 1 s.  I don't think there would be any side-effects, like rounding
problems, as the shorter date in the comparison effectively determines the
number of decimal digits used.

Personally, I'm completely satisifed with a 1 s resolution.

Regards,
Camillo
[examples sorted using MS Excel]
-- 
Camillo Sdrs <Camillo.Sars@DataFellows.com>   Data Fellows Ltd.
F-Secure Support
http://www.Europe.DataFellows.com/      Aim for the impossible and you
http://www.iki.fi/ged                   will achieve the improbable

References: