This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author martin.panter
Recipients Decorater, martin.panter, serhiy.storchaka
Date 2017-03-23.08:16:47
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1490257007.57.0.692868418834.issue29885@psf.upfronthosting.co.za>
In-reply-to
Content
Does the “astimezone” method work for you? <https://docs.python.org/3.5/library/datetime.html#datetime.datetime.astimezone>

>>> from datetime import *
>>> aedt = timezone(+timedelta(hours=11))
>>> local = datetime.now(aedt)
>>> format(local)
'2017-03-23 19:14:41.410334+11:00'
>>> gmt = local.astimezone(timezone.utc)
>>> format(gmt)
'2017-03-23 08:14:41.410334+00:00'
History
Date User Action Args
2017-03-23 08:16:47martin.pantersetrecipients: + martin.panter, serhiy.storchaka, Decorater
2017-03-23 08:16:47martin.pantersetmessageid: <1490257007.57.0.692868418834.issue29885@psf.upfronthosting.co.za>
2017-03-23 08:16:47martin.panterlinkissue29885 messages
2017-03-23 08:16:47martin.pantercreate