How do I store an UTC ISO8601 date in a MySQL database?
I have thousands of dates in the following format: 2011-10-02T23:25:42Z (aka ISO 8601 in UTC) What MySQL data type should I use for storing such a ISO8601 date in a MySQL database? E.g. Datetime , timestamp or something else? Which is best for comparison (eg. getting records between two dates/times) and ordering the results from queries? What about if the database is very large? And what would be the best way to convert the above PHP string for MySQL storage? (I'm guessing date_default_timezone_set('UTC'); would be used?) I think that keeping your date-time values in field of type DATETIME