So here I am trying to figure out how to convert a matching format.
What I have done right now is that I have following code:
xmas_time = '2018-12-24T00:00:00+01:00'
utc_date = datetime.strptime(xmas_time, "%Y-%m-%dT%H:%M:%S%z").replace(tzinfo=timezone.utc)
etatime = utc_date.astimezone(pytz.timezone('Europe/Stockholm'))
merry_xmas = etatime.strftime('%Y-%m-%d %H:%M:%S')
print(merry_xmas)
however I am getting an issue saying:
ValueError: time data '2018-12-24T00:00:00+01:00' does not match format '%Y-%m-%dT%H:%M:%S%z'
which I believe I probably did the match format incorrect and here I am needing help how I will be able to solve that!
Output that I would wish is: yyyy-mm-dd hh-mm-ss