I just want a good time...
August 20, 2007 9:34 AM
Subscribe
DATETIME, TIMESTAMP, TIME, DATE. Which should I use for general-purpose date storage in a recent MySQL version?
So I'm building a calendar among other things... and I'd like to store the date that events start. It's in PHP and CodeIgniter. I'd like to store dates in something reasonably mainstream and efficient. I've seen both Timestamp and Datetime used, rarely Time or Date. What are the +/-s for these guys? Or, at least, which you would use?
Thanks, this is a total mystery to me.
posted by tmcw to computers & internet (16 comments total)
1 user marked this as a favorite
If using datetime, you can convert to/from Unix timestamps within the queries if that's easiest, using UNIX_TIMESTAMP() and FROM_UNIXTIME().
posted by malevolent at 10:21 AM on August 20, 2007