E
E
eofal2017-12-01 06:36:54
Python
eofal, 2017-12-01 06:36:54

ValueError: time data 'Nov 13, 2017 21:30' does not match format '%d %B %Y %H:%M' What format do you need?

I'm new and I can't extract a date from a string.
I think the simplest option should look something like this: but an error pops up: ValueError: time data 'November 13, 2017 21:30' does not match format '%d %B %Y %H: %M' Tell me what format is needed or what needs to be done to start writing the date from the string.
dt = datetime.strptime(date1, '%d %B %Y %H:%M')

Answer the question

In order to leave comments, you need to log in

2 answer(s)
L
longclaps, 2017-12-01
@longclaps

I suggest (this is your format string, if so):
print(datetime.now().__format__('%d %B %Y %H:%M'))

D
Dimonchik, 2017-12-01
@dimonchik2013

strftime.org

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question