What's the best method for recording times in a MySQL database? For years, I've used unix timestamps (i.e. 1323092395) but when I need to take DST into account, it becomes an issue.
For example, Client A wants an e-mail sent to her at 5am every day. The time is recorded as a unix timestamp in my database. When DST starts, the server time is automatically adjusted back an hour, and suddenly, Client A starts receiving e-mails at 4am because the unix timestamp is a relative number, not a fixed point in time such as a UTC timestamp.
I've read Ray Paseur's great article from EE about Handling Date and Time in PHP and MySQL, but those solutions are all PHP based. I would like to do the time adjustments on the MySQL end, so I don't have to perform a time function on every record in the DB.
Should I use UTC, RFC 2822? If I use those formats, would I be able to perform a MySQL query that takes into account the time change?
Thank you,
marc