On Fri, 3 Nov 2006, Zefram wrote:

Dave Rolsky wrote:
Pretty much all DBMS's (ok, not SQLite) have support for datetime as a
data type.

Worms.  Can thereof.  A datetime type is not a primary feature of a DBMS,
so it's probably not had much attention paid to it.  Until recently,
MySQL's datetime type allowed dates such as 2006-04-31.  Even if it's
implemented correctly, it'll implement some arbitrarily selected date
model that's not particularly likely to match your need.  In this case,
timezone behaviour is the issue, and not very many datetime types handle
multiple timezones in the way desired.

Clearly, MySQL is not the gold standard for this sort of thing. It's more like a tin standard ;)

Postgre handles datetime type nicely, and supports real time zones.

I still think that using the built-in date and datetime types is a better choice than breaking it down into components and storing those. After all, MySQL wouldn't validate your "week number" either. On an OT-note, this is why a DBMS should have good support for creating your own types, though AFAIK none really do.

Using a DBMS's datetime type also loses you portability, of course.

There's another can of worms. My answer to that is I generally don't care. If I pick a tool I'm picking it because I want to make use of it. Programming in Perl loses portability too, because I need to have Perl (and probably a minimum version) installed too.

Anyway, this rather OT.


-dave

/*===================================================
VegGuide.Org                        www.BookIRead.com
Your guide to all that's veg.       My book blog
===================================================*/

Reply via email to