def age_in_years(birthdate):
"""
Determines an age in years based off of the given arrow.Arrow birthdate
and the current date.
"""
now = arrow.now()
is_upcoming = (now.month, now.day) < (birthdate.month, birthdate.day)
return now.year - birthdate.year - int(is_upcoming)
评论列表
文章目录