[BirthDate] Un coup de PEP8
This commit is contained in:
parent
b2003525a7
commit
dc1600000d
1 changed files with 4 additions and 4 deletions
|
@ -14,10 +14,10 @@ def execute(macro, text):
|
|||
year, month, day = text.split(",")
|
||||
y, m, d = int(year), int(month), int(day)
|
||||
now = datetime.datetime(*time.localtime()[:6])
|
||||
if m==2 and d==29:
|
||||
birthdate = datetime.datetime(now.year, 3, 01)
|
||||
if now.month==2 and now.day==29:
|
||||
now = datetime.datetime(now.year, 3, 01)
|
||||
if (m, d) == (2, 29):
|
||||
birthdate = datetime.datetime(now.year, 3, 1)
|
||||
if (now.month, now.day) == (2, 29):
|
||||
now = datetime.datetime(now.year, 3, 1)
|
||||
else:
|
||||
birthdate = datetime.datetime(now.year, m, d)
|
||||
age = now.year - y
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue