from datetime import datetime,timedelta
a = input()
(b,c,d) = a.split()
e = int(b)
f = int(c)
g = int(d)
today = datetime(e,f,g)
tomorrow = today + timedelta(days=1)
s = tomorrow.strftime("%Y%m%d")
In this code, if the value of e is a four-digit number, it can be taken as %Y and processed If it's a 5-digit number, is there any way to get the value and deal with it? I'd appreciate it if you let me know.
python
Suppose that e
can be 5 digits, drink . According to Python datetime official document , MAXYEAR
is 99999.
© 2024 OneMinuteCode. All rights reserved.