[Zope3-dev] Dates and times

Stephan Richter stephan.richter@tufts.edu
Fri, 15 Nov 2002 14:44:14 -0500


On Friday 15 November 2002 14:34, Tim Peters wrote:
> [Steve Alexander, makes houmous for us]
>
> > ...
> >    Start time                         10am
>
> Then you would attach 10am (a time) to a datetime object (representing the
> day on which you begin), yielding a datetime representing your starting
> time.

But I think Steve's point was that you do NOT know the date!

> >    Time of first change of water      10am + 1 hour  = 11am
>
> This "1 hour" is an interval, not "a time".  You would add a 1-hour
> timedelta to the datetime object from the first step, yielding a datetime
> object representing time-of-first-change-of-water.  If you happened to
> begin at 11:46pm, no problem -- it would shift to the next day.

He did not argue that 1 hour is a time; I think he implied it is a timedelta.

> > Another more common example is planning a workshop. The activities in a
> > workshop are of a known length. You sometimes need to plan the days of
> > a workshop, and then choose the dates later.
>
> I'd plan for a specific day for the sake of concreteness, then add whatever
> day timedelta turned out to be appropriate.

But that is often unpractical. How do you want to represent something like: 
every Monday at 11:00 am? Seriously, it is not always applicable to talk 
about a date in combination with a time. One thing you could do is to assign 
the date 01/01/0000 to your time until you know better (this also solves the 
carry bit problem). However, this seems like a hack to me.

Regards,
Stephan
-- 
Stephan Richter
CBU Physics & Chemistry (B.S.) / Tufts Physics (Ph.D. student)
Web2k - Web Software Design, Development and Training