On Wed, Sep 5, 2012 at 11:00 PM, staticsafe <m...@staticsafe.ca> wrote:
>
> In [68]: showinfo['RFC3339']
> Out[68]: '2012-09-10T21:00:00-4:00'

You can parse the ISO format using the dateutil module:

http://labix.org/python-dateutil

    >>> from dateutil.parser import parse
    >>> show_time = parse('2012-09-10T21:00:00-4:00')

This produces a time-zone aware datetime object. You can pass its
tzinfo to datetime.now() to get the current time as an aware datetime
object:

    >>> now = datetime.now(show_time.tzinfo)

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.
_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to