[Zope3-dev] Dates and times

Barry A. Warsaw barry@zope.com
Fri, 15 Nov 2002 10:28:10 -0500


>>>>> "GvR" == Guido van Rossum <guido@python.org> writes:

    GvR> How would you define arithmetic on times?  Can you provide
    GvR> some examples of what it should do IYO and why?

    GvR> (Remember that you *can* do arithmetic on datetime.  We're
    GvR> talking here about time only, i.e. you have a range of 24
    GvR> hours only.)

Can we add time to a datetime?  Say I want something to happen at
4:30am every day, and I have a datetime for tomorrow at midnight.  I
should be able to add 4 1/2 hours to that datetime to get the target
datetime.  Or, say I want to add 36 hours and 27 minutes to a datetime
that represents right now.  All those things should be possible right?
I guess the latter example can't use a time value to represent "36
hours and 27 minutes" if we're limited to a 24 hour range.

-Barry