It's your choice, really. You could store it as TEXT, in some standardised format (e.g. XML dateTime format: yyyy-mm-ddThh:mm:ss.ffff plus a timezone offset if you wanted) or your own format, and query it back as text, or you could store it in UNIX integer time (seconds since unix epoch (01/01/1970)) - so in an INTEGER field, etc. Depends how you're going to use it. Either way I've suggested has pros/cons.
Nick. -----Original Message----- From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of dotolee Sent: 23 January 2012 18:01 To: sqlite-users@sqlite.org Subject: Re: [sqlite] storing and comparing dates in sqlite can you point me in the right direction? aka. what data type am i using to store the date in my sqlite database? is TEXT correct? how do I do a select on it? thanks. Stephan Beal-3 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. > IMO Unix timestamps are the most portable form out there. "Portable" > meaning, in this context, the ability to work with them (more or less > easily) in a wide variety of contexts. > > > -- > ----- stephan beal > http://wanderinghorse.net/home/stephan/ > http://gplus.to/sgbeal > _______________________________________________ > sqlite-users mailing list > sqlite-users@sqlite.org > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users > > -- View this message in context: http://old.nabble.com/storing-and-comparing-dates-in-sqlite-tp33189769p33189862.html Sent from the SQLite mailing list archive at Nabble.com. _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users