On 21/06/2005 6:55 p.m., Sebastian wrote:
i never understand why people use datetime anyway.. unix timestamp is so much easier to work with.
Because DATETIME is stored natively as a date and time, which means you can then use the date and time SQL functions with them (such as DATE_ADD, DATE_SUB, DATE_FORMAT etc). If you just store your date as a timestamp in an INT then you first have to convert it into a DATETIME using FROM_UNIXTIME. Admittedly not difficult, but an additional and unnecessary conversion.
For me it's really just a matter of "rightness" - why store a date as an int when you can store it as a date? :)
Also a question of whether you prefer to do date manipulations in your application or at the SQL level. But both ways work.
-Simon -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]