On 23 Jan 2012, at 5:53pm, Stephan Beal wrote:

> On Mon, Jan 23, 2012 at 6:51 PM, dotolee <woo_ju...@yahoo.com> wrote:
> 
>> i'm new to sqlite... and relatively new to php.  just wondering what the
>> best way is to store and compare dates.
> 
> For any given 10 developers you'll likely hear 11 opinions on this topic.

How true.  For what it's worth, here's mine:

1) read

http://www.sqlite.org/lang_datefunc.html

2) If you need to do maths on dates (how many days apart are two dates, what's 
three days after this date, etc.) store your dates as numbers, either julianday 
or unixepoch.

3) Otherwise store them as text, in YYYYMMDD format, so they're easy to read 
when you're debugging.

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

Reply via email to