What is the format for this datetime?

I'm trying to get the datetime format of this 2021-10-21T08:11:00.0000000Z so that I can use python's datetime.strptime on it.

2 answers

  • answered 2021-10-24 16:28 Parzych

    Try dateutil library. This automatic recognize string datetime and transform it to datetime object.

    from dateutil import parser 
    str_time= "2021-10-21T08:11:00.0000000Z"
    ob_time = parser(str_time)

  • answered 2021-10-24 16:30 ashbit_

    I just use strftime("%{any key}") for that.

    (P.S. those curly brackets are placeholders)

How many English words
do you know?
Test your English vocabulary size, and measure
how many words do you know
Online Test
Powered by Examplum