[development] no date / time types in schema API
Ivan Sergio Borgonovo
mail at webthatworks.it
Wed Jul 2 15:09:04 UTC 2008
On Wed, 2 Jul 2008 14:07:27 +0000
"David Strauss" <david at fourkitchens.com> wrote:
> A timezone should not be stored within the same field as a time.
> It should be stored separately and used to calculate local times,
> as necessary.
> The entire idea of storing a timestamp as a local time alongside
> its timezone is bad on so many levels.
You're not forced to store dates with tz but having a data type that
understand tz and support tz operations inside the DB is pretty
helpful.
Again... suppose you store datetime in GMT and you want to know who
had a beer before 1:00am local time maybe during a DTS change [evil
grin]?
a tz is not an integer. You can't compute the interval on the PHP
side and you don't want to return all the times and filter on the PHP
side either.
Anyway tz support across different DB looks much harder to handle
than different date format since the "interface" is much more
heterogeneous.
> Oh, and good luck dealing with your DB server sometimes having a
> different timezone than your web server.
That's life. Anyway MySQL as well as PostgreSQL provide nifty
settings to cope with the problem.
--
Ivan Sergio Borgonovo
http://www.webthatworks.it
More information about the development
mailing list