IMO, dates are a pain. I spent considerable time trying to decide how best to store dates in my app(s), and eventually chose to use Unix times (integers). It seemed an easy choice as I program in Perl and JavaScript.
Lately, I've begun to regret the choice I made. Every ad-hoc query I need to do (select * from mytable...) becomes an exercise in using SQLite date functions. If I had it to do over, I would probably store my datetimes as YYYY-MM-DD HH:MM:SS strings. I thought about storing as julians, too, but it's the same issue when you need human-readable dates in ad-hoc queries. YMMV. My apps are all web-based, and I frequently need to look at stored data using ad-hoc queries. -Clark ----- Original Message ---- From: Lloyd <[EMAIL PROTECTED]> To: sqlite-users@sqlite.org Sent: Tuesday, November 7, 2006 2:30:34 AM Subject: Re: [sqlite] Date data type Thanks gg and Craig Morrison for your informative reply. I would like to know one more thing, can I use these date and time functions with comparison operators? Will they return the correct result or as per the string comparison rules? Thanks again, Lloyd. On Tue, 2006-11-07 at 04:25 -0500, Craig Morrison wrote: > Lloyd wrote: > > Hi, > > How can I manage date and time using sqlite? [Do I have to do it > > outside sqlite?] > > http://www.sqlite.org/cvstrac/wiki?p=DateAndTimeFunctions > ______________________________________ Scanned and protected by Email scanner ----------------------------------------------------------------------------- To unsubscribe, send email to [EMAIL PROTECTED] ----------------------------------------------------------------------------- ----------------------------------------------------------------------------- To unsubscribe, send email to [EMAIL PROTECTED] -----------------------------------------------------------------------------