Re: DATETIME or UNIX TIMESTAMPS?
| From: | Larry Garfield | Date: | Fri, 27 Oct 2006 04:10:44 +0000 |
| Subject: | Re: DATETIME or UNIX TIMESTAMPS? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-243721@lists.php.net to get a copy of this message | ||
On Thursday 26 October 2006 15:36, Marcelo de Moraes Serpa wrote:
> Hello list,
>
> I've always used Unix Timestamps until now, but lately I've reading about
> MySQL's datetime datatype and its benefits (dates before 1970, after 2030,
> SQL functions to deal with them, etc). However, I don't see much support
> for them in the PHP API. I'm also a Flash programmer and the Flash 8 API
> Date datatype also only understands unix timestamps. Taking this into
> account, I'm not really sure if it really worths it to "move" to the
> DATETIME datatype. What would you do? Any advice would be much appreciated!
>
> Marcelo.
I tend to stick to unix timestamps as well, because date formats are
completely unstandard between different SQL databases. MySQL's date futzing
functions are nice, but they're different than Postgres', which are different
than Oracle's, etc.
Generally, most of the the math I need to do I can do in PHP either before or
after grabbing the timestamp.
I am sure there is a counter point, but this for what I do I just stick to
timestamps. :-)
--
Larry Garfield AIM: LOLG42
larry@garfieldtech.com ICQ: 6817012
"If nature has made any one thing less susceptible than all others of
exclusive property, it is the action of the thinking power called an idea,
which an individual may exclusively possess as long as he keeps it to
himself; but the moment it is divulged, it forces itself into the possession
of every one, and the receiver cannot dispossess himself of it." -- Thomas
Jefferson