import iso8601
import pytz
_date_obj=iso8601.parse_date("2018-09-07T04:57:58.050-07:00")
_date_utc=_date_obj.astimezone(pytz.timezone('America/Toronto'))
_date_utc_zformat=_date_utc.strftime('%Y-%m-%dT%H:%M:%SZ')
print(_date_utc_zformat)
import iso8601
import pytz
_date_obj=iso8601.parse_date("2018-09-07T04:57:58.050-07:00")
_date_utc=_date_obj.astimezone(pytz.timezone('America/Toronto'))
_date_utc_zformat=_date_utc.strftime('%Y-%m-%dT%H:%M:%SZ')
print(_date_utc_zformat)
Distraction-free reading. No ads.
Organize your knowledge with lists and highlights.
Tell your story. Find your audience.
Read member-only stories
Support writers you read most
Earn money for your writing
Listen to audio narrations
Read offline with the Medium app