PHP's mktime() function uses a timestamp that is the number of seconds 
since the Unix epoch.  MySQL uses the YYYYMMDDhhmmss format for its 
TIMESTAMP column type.

I'm not complaining that they're not the same, but curious as to which I 
should use for storing timestamps -- does it matter?  PHP has a lot of 
nice formatting conventions with date(), so I am leaning towards using 
mktime() to store PHP-style timestamps into a MySQL TIMESTAMP column.  
But MySQL does have the ability to format dates, and its TIMESTAMP 
column type bumps up if I don't manually insert a value.

Any suggestions?



Erik Price
Web Developer Temp
Media Lab, H.H. Brown

PHP General Mailing List (
To unsubscribe, visit:

Reply via email to