[Zope3-dev] Dates and times
Stephan Richter
stephan.richter@tufts.edu
Fri, 15 Nov 2002 12:04:44 -0500
On Friday 15 November 2002 11:47, Guido van Rossum wrote:
> > I think that a time object is good, even though it will not need
> > much arithmatic. I think time +/- timedelta and time-time=timedelta
> > is enough. When I was writing Proiektor back in the days, I played
> > a lot with that for the reasons Barry listed. If you have for
> > example a meeting every Monday (excluding holidays) at 4:30 pm, then
> > I usually coded this by defining a time 4:30 pm with some logic
> > describing the repeating Mondays.
>
> What's your use case for adding a timedelta to a time?
The following use case is a mood point, but I find it useful:
When I have a meeting, I often say that I meet at 4:30 pm for an hour, not I
meet from 4:30 pm to 5:30 pm. Therefore I can store the duration of a meeting
in a time delta and to calculate the end of a meeting I just add it to the
start time. Others might claim that storing the beginning and the end is
better...
Also, databases (especially PostGreSQL, which has an awesome datetime support)
support the notion of time and timedelta arithmatic.
Regards,
Stephan
--
Stephan Richter
CBU Physics & Chemistry (B.S.) / Tufts Physics (Ph.D. student)
Web2k - Web Software Design, Development and Training