Simplest solution for formatting local time in iso 8601 including time zone.
Chris Rebert
clp at rebertia.com
Wed Sep 10 00:40:57 EDT 2008
More information about the Python-list mailing list
Wed Sep 10 00:40:57 EDT 2008
- Previous message (by thread): Simplest solution for formatting local time in iso 8601 including time zone.
- Next message (by thread): wxpython ms-dos black window popping up in background
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On Tue, Sep 9, 2008 at 9:32 PM, <rowland at river2sea.org> wrote: > What's the simplest solution for formatting the output of local time > in iso 8601 including the time zone information? > > Example: > > "2008-07-25T14:28:43.934-04:00" You want the isoformat() method of datetime objects. See http://docs.python.org/lib/datetime-datetime.html for details. You'll need to pass 'T' as the separator to isoformat() and pass in a tzinfo object when constructing the datetime object. Regards, Chris > > > Thanks, > Rowland > > -- > http://mail.python.org/mailman/listinfo/python-list > -- Follow the path of the Iguana... http://rebertia.com
- Previous message (by thread): Simplest solution for formatting local time in iso 8601 including time zone.
- Next message (by thread): wxpython ms-dos black window popping up in background
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list