On a le droit de naître le 29 février #céciliasrequest
This commit is contained in:
parent
3e17aee6cc
commit
1bb4c8402b
1 changed files with 7 additions and 1 deletions
|
@ -14,7 +14,13 @@ def execute(macro, text):
|
||||||
year, month, day = text.split(",")
|
year, month, day = text.split(",")
|
||||||
y, m, d = int(year), int(month), int(day)
|
y, m, d = int(year), int(month), int(day)
|
||||||
now = datetime.datetime(*time.localtime()[:6])
|
now = datetime.datetime(*time.localtime()[:6])
|
||||||
birthdate = datetime.datetime(now.year, m, d)
|
birthdate = now
|
||||||
|
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)
|
||||||
|
else:
|
||||||
|
birthdate = datetime.datetime(now.year, m, d)
|
||||||
age = now.year - y
|
age = now.year - y
|
||||||
if now < birthdate:
|
if now < birthdate:
|
||||||
age -= 1
|
age -= 1
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue