You have one %
too many after the %m
directive; %/
is not a valid directive and the ValueError
tells you just that.
Use:
datetime.strptime('01/04/2014', '%d/%m/%Y')
instead, using %Y
(capital Y
) to parse a year with century.
Demo:
>>> datetime.strptime('01/04/2014', '%d/%m/%Y')
datetime.datetime(2014, 4, 1, 0, 0)