why strptime for two digit year for 69 returns 1969 in python?
问题 Look at the following code, def expdate(date): _exp_date = datetime.strptime(date, "%m%y") >>> expdate('1268') 2068-12-01 00:00:00 >>> expdate('1269') 1969-12-01 00:00:00 Optionally how to actually overcome this and get 2070 ? I'll be checking only using 2 digits years. 回答1: Python depends on the platform’s C library, which generally doesn’t have year 2000 issues, since all dates and times are represented internally as seconds since the epoch. Functions accepting a struct_time generally