1

When I trying a such date all working finely

datetime.datetime.strptime('4/20/69', '%m/%d/%y').date()
# according to the docs: %y Year without century as a zero-padded decimal number.

I got

datetime.date(1969, 4, 20)

But when I'm trying a such date (year = 50)

datetime.datetime.strftime('4/20/50', '%m/%d/%y').date()

I got

datetime.date(2050, 4, 20)

So why I got year = 2050 instead of 1950? There any additional docs or paramters to get get correct year (all values lower 2000 converting to 19xx) ?

0 Answers0