Your attributes are in reverse order.

It sohuld be datetime.strptime('1/1/18', format_string)

Minimal example:

from datetime import datetime as dt

help() result on strptime:

Help on built-in function strptime:

strptime(…) string, format -> new datetime parsed from a string (like time.strptime()).

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top