On Thu, Sep 6, 2012 at 3:50 AM, Dave Angel <d...@davea.name> wrote: > On 09/06/2012 03:35 AM, eryksun wrote: >> <Snip> >> Or you could use datetime.now(dateutil.tz.tzutc()) for a UTC tzinfo. >> It doesn't matter if you're only interested in the timedelta. > > Actually, it can matter. Whenever possible, produce all times as UTC > and do your manipulations (eg. difference) in that space. With local > time, there are times that don't exist and times that are ambiguous, one > in the fall and one in the spring, due to setting the clock forward or back. > > i don't know for sure if it matters here, but I've found it's better to > work that way.
These are aware datetime objects. See the datetime docs for supported operations, case 3, timedelta = datetime1 - datetime2: http://docs.python.org/library/datetime#datetime.datetime.tzinfo _______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor