DB Date and Times (was: Re: [PEAR-DEV] Re: DB_Table: Summary and Pre-Call)

From: Date: Tue, 13 Apr 2004 09:44:57 +0000
Subject: DB Date and Times (was: Re: [PEAR-DEV] Re: DB_Table: Summary and Pre-Call)
References: 1  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-27540@lists.php.net to get a copy of this message
<hans@velum.net> wrote : > Anyway, it's possible that by eliminating native dates/times you have > attained a pretty low-level SQL requirement. On the other hand, as soon A question about dates and times in different DBs... I have taken the habit to use a unix epoch timestamp in my tables instead of the date functions of the various RDBMS (DATE_FORMAT, TO_CHAR...). I chose this solution because I found that PHP had a good handling of unix timestamps (they are usable in almost every date and times functions) and I have had to migrate an app from MySQL to Oracle and all the problems I had came from dates mostly. Still, I have no idea of which features or performance I am loosing by doing so. Of course, I know that unix timestamp are limited to 1970 (so no date of birth for example), but I was thinking that the julian day number could be used as well for other dates representation (the number of days since noon in Greenwich on November 24, 4714 B.C). This way, all my dates are just integers. I am not a db or datatypes expert so any comments would be welcome :) Bertrand Mansion Mamasam

« previous php.pear.dev (#27540) next »