On Fri, 17 Jun 2005, Jonathan Leffler wrote:
DATE has components from year down to day; TIME has components from hour
down to microseconds (or finer); and TIMESTAMP contains components from
How can you have a time with a time zone when it has no date? Weirdness.
I would certainly like to see classes corresponding to DATE and TIMESTAMP.
Whether you need the separate class corresponding to TIME is more
debatable. SQL also has an INTERVAL type, which can describe durations of
I can see a generic "clock" class that just represented times _without_ a
time zone being useful. I think Rick Measham had proposed that before.
So, I recommend that you do indeed support two distinct sets of
inter-related calculations - one on dates without time or timezone, and
one on timestamps including timezones.
A date (but no time) with a timezone doesn't seem very useful.
There's also the question of what kind of date math people want for
datetimes with a timezone. I'd be inclined to only provide math on the
wall clock (local) time. If you wanted math based on the underlying UTC
time you could always convert both objects to UTC first. And it'd be easy
enough to create a utility function for this or something.
-dave
/*===================================================
VegGuide.Org www.BookIRead.com
Your guide to all that's veg. My book blog
===================================================*/