Dates/Times tend to be handled differently by different databases. I've always tried to stay database-neutral in terms of date/time handling - a technique I like to use is to convert timestamp fields into "seconds since the epoch" which is an integer number of seconds since 1/1/1970. Then doing date calculations are easy. MySQL has a function(MySQL specific) called UNIX_TIMESTAMP() which returns the date as the number of seconds since the epoch. If you use a TIMESTAMP or DATETIME column, you can write a subroutine to convert that into an "seconds since the epoch" number.