I'm trying to convert this string to a datetime object in Python. I don't understand the time part of the string '+00:00'. What does that mean and how do I format this string? '2021-01-04 04:00:00+00:00'
Thank you
I'm trying to convert this string to a datetime object in Python. I don't understand the time part of the string '+00:00'. What does that mean and how do I format this string? '2021-01-04 04:00:00+00:00'
Thank you
From the documentation, that is the timezone indicator. +00:00
represents UTC.
The string format indicator for timezone is %z
.
%z | UTC offset in the form ±HHMM[SS[.ffffff]] (empty string if the object is naive).