Posted by Michael Fesser on 12/27/07 22:24
..oO(Iván Sánchez Ortega)
>BTW, when you're programming, try to get timestamps instead of DATETIMEs.
Depends.
>handling DATETIMEs can be nasty if you don't pay enough attention,
So can Unix timestamps.
>but
>handling integer numbers (that can be fed to date() later)
DATE_FORMAT() exists.
>is usually
>easier.
Depends on what you're going to do with it. For me DATE/DATETIME is much
better since it's not restricted in its range and can be used with all
of MySQL's date and time functions without having to convert it first.
Internally all my dates are stored with a native date type. If I should
really need a Unix timestamp in PHP, I return it with UNIX_TIMESTAMP()
from the DB.
YMMV.
Micha
[Back to original message]
|