develooper Front page | perl.datetime | Postings from January 2006

Re: Best practices - DateTime vs Database question

Thread Previous | Thread Next
From:
kellan
Date:
January 17, 2006 10:03
Subject:
Re: Best practices - DateTime vs Database question
Message ID:
422b9b380601170913u71f22d2ap2282a071cc3445ad@mail.gmail.com
On 1/17/06, Dave Rolsky <autarch@urth.org> wrote:

> > a) Native MySQL DATETIME field?
>
> I'd go with this one, since it will make it easiest to do many operations
> in the DBMS (sorting, restriction queries by date, etc).
>

With the caveat that MySQL's understanding of timezones can be a bit
unpredictable, especially between versions.  (we've had a slew of
problems initially)

If you are going to use native datetime fields (or even if you aren't)
I'd strongly suggesting storing all your dates as UTC, and set your
MySQL's timezone to UTC, and don't do anything in the database that
requires timezone math.  Use DateTime.pm for that.

-kellan

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About