Originally posted by philzilla:
what's the preferred method with y'all? which do you find plays best with php:
timestamp or datetime?
examples would be nice with your answers
Datetime - it's much easier to read when I'm browsing through records with phpmyadmin!
These days I'm using Smarty more often than not, and it prefers a unix timestamp for its date_format conversion, so I'll always perform an SQL like:
SELECT UNIX_TIMESTAMP(date_created) FROM table
when I'm retrieving, then an
INSERT INTO table (date_created) VALUES (".date('Y-m-d h:i:s',$timestamp)
when I put it back
This way I can also utilise native SQL date functions and they'll perform as expected