[DB-SIG] DateTime: Changing the time value handling ?!

Jim Fulton jim.fulton@digicool.com
Wed, 11 Mar 1998 08:51:08 -0500


Greg Stein (Exchange) wrote:
> 
> Why should Unix ticks be any different from the others? All of the times are
> absolute with respect to an unknown time zone. You have NOT picked any time
> zone. If you generate a ticks value, then somebody should use that with
> respect to the proper time zone.
> 
> Generally, the only point where a time zone becomes apparent is when people
> use something like the .Format() method (or time.ctime()) and the output
> includes a time zone string.

It also comes in to play when you do math on times.  9pm EST - 8pm PST 
is *not* one hour.

These sorts of issues are important if you have to deal with times 
from multiple time zones, or use time data from one time zone in 
another.

> It sounds like people are mixing time zones values. e.g. they create a
> DateTime assuming it is within the current time zone, but then pass it to a
> function in the time module that expects a UTC time (or vice versa).
> 
> A large part of the discussion has historically fallen around time zone
> handling. The unofficial consensus has always come out of that with "don't
> build time zone information into the base types" (let higher levels deal
> with it)

The ODMG standard includes time zone in it's Time and Timestamp classes.
They take a fairly minimalist approach.  Their time zones are just
offsets
from UTC.  They leave deciding *what* the offset is (e.g. dealing with 
daylight savings time) to the application.
 
> I would highly recommend the absolute avoidance of anything that infers /
> implies time zones within the base data types.

I disagree with this statement, although not entirely.  As I have 
said before, I think the Date-Time classes should be based on the 
ODMG standard which provides a *mimimalish*, but useful, treatment 
of time zones.

Jim

-- 
Jim Fulton           mailto:jim@digicool.com
Technical Director   (888) 344-4332             Python Powered!
Digital Creations    http://www.digicool.com    http://www.python.org

Under US Code Title 47, Sec.227(b)(1)(C), Sec.227(a)(2)(B) This email
address may not be added to any commercial mail list with out my
permission.  Violation of my privacy with advertising or SPAM will
result in a suit for a MINIMUM of $500 damages/incident, $1500 for
repeats.

_______________
DB-SIG  - SIG on Tabular Databases in Python

send messages to: db-sig@python.org
administrivia to: db-sig-request@python.org
_______________