On 22 Dec 2011, at 9:44pm, Jean-Christophe Deschamps wrote:

> IMHO if dates are to be stored in string format, then one should always store 
> them in YYYY/MM/DD (with leading zeroes) then eventually display dates in 
> whatever format suits users at the application level. 

To save you time in the long run, store dates as YYYYMMDD and date/timestamps 
as YYYYMMDDTHHMMSS (where 'T' is the actual letter 'T').  It takes very little 
storage.  It allows a human to read and understand the dates without processing 
them, which is extremely useful when debugging.  It allows comparisons (= < >) 
of dates, timestamps and both, though you can't subtract one date/time from 
another to give an interval.

I found this format in ISO but I forget which one.

If, on the other hand, you're actually going to do lots of maths on dates or 
times, just store them as integers.

Simon.
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to