0

I have following part of script:

time = datetime.strptime(msg['timestamp'].split('.')[0],'%Y-%m-%dT%H:%M:%S') 

msg['timestamp'] is string. I would like to converted this time to CEST. Do you have any ideas?

Best Regards

Taz
  • 1
  • 1
  • 2
    Does this answer your question? [How to make a timezone aware datetime object](https://stackoverflow.com/questions/7065164/how-to-make-a-timezone-aware-datetime-object) – Yevhen Kuzmovych Oct 21 '22 at 10:31
  • I saw the link earlier but i can't put it all together. Finally I use this `time = datetime.strptime(msg['timestamp'].split('.')[0],'%Y-%m-%dT%H:%M:%S') timestamp = time+ timedelta(hours=2) ` – Taz Oct 21 '22 at 11:39

1 Answers1

0

Finally I use this

time = datetime.strptime(msg['timestamp'].split('.')[0],'%Y-%m-%dT%H:%M:%S') timestamp = time+ timedelta(hours=2)

Taz
  • 1
  • 1