Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- >>> from dateutil import parser
- >>> from dateutil.tz import tzutc, tzlocal
- >>>
- >>> s = 'Sun Oct 31 15:43:19 +0000 2010'
- >>>
- >>> d = parser.parse(s)
- >>> print d
- 2010-10-31 15:43:19+00:00
- >>>
- >>> d = d.astimezone(tzlocal())
- >>> print d
- 2010-11-01 00:43:19+09:00
- >>>
- >>> d = d.astimezone(tzutc())
- >>> print d
- 2010-10-31 15:43:19+00:00
Add Comment
Please, Sign In to add comment