0

I am struggling to convert to a datetime object the following string : '2021-06-18T23:10:49.014844Z', in particular I don't understand what the suffix means. I thought it could be a timezone ? What is the right directive to use ?

Roland
  • 11
  • 3
  • You can look at [strftime() and strptime() Format Codes](https://docs.python.org/3/library/datetime.html#strftime-and-strptime-format-codes) – ThePyGuy Jul 24 '21 at 12:36
  • Z is an offset indication, something like UTC+0 here. – Sajal Jul 24 '21 at 12:56
  • ValueError: time data '2021-07-09T21:01:49.926811Z' does not match format '%Y-%m-%dT%H:%M:%S.%f%Z' – Roland Jul 24 '21 at 13:23

0 Answers0