Answer the question
In order to leave comments, you need to log in
How to parse Datetime knowing the timezone?
Good afternoon!
Such a date comes into view 06/23/2015 13:52 , is it known in which timezone it is, how to parse it and write it to the database in UTC?
Undercode
import datetime
date = '23.06.2015 13:52'
parse_date = datetime.datetime.strptime(date, "%d.%m.%Y %H:%M")
dt_utc = pytz.timezone(utc).localize(parse_date)
print dt_utc
2015-06-23 13:52:00+00:00
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question