icecool10
icecool10

Reputation: 41

Date time in Python (strftime)

Time data 'Jun 02 16:06:57.451' does not match format '%m %d %H:%M:%S.%f'

datetime.strptime(input_time, "%m %d %H:%M:%S.%f")

Upvotes: 0

Views: 58

Answers (1)

skrubber
skrubber

Reputation: 1095

Change the format to exactly the way you're supplying the date:

 datetime.strptime('Jun 02 16:06:57.451',"%b %d %H:%M:%S.%f")

datetime.datetime(1900, 6, 2, 16, 6, 57, 451000)

Format types are here: Formats

Upvotes: 1

Related Questions