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. Using a DBMS's datetime type also loses you portability, of course. >The advantage to this is that your datetime data is stored in a consistent >way, so if you ever need to compare datetimes for some reason, you know >that they'll compare sanely. I think what he wants to store isn't actually a date, as in a point in time. Looks like he wants to store a time of week, timezone-relative, along with a timezone spec. The incrementing loop he came in with is just answering the question "when will that time of week next occur?". -zefram