Skip to content

Instantly share code, notes, and snippets.

@nanzono
Created July 23, 2013 03:35
Show Gist options
  • Save nanzono/6059667 to your computer and use it in GitHub Desktop.
Save nanzono/6059667 to your computer and use it in GitHub Desktop.
80歳が寿命だとして。
# coding:utf-8
import datetime
def print_days(birth_year, birth_month, birth_day, target_year):
birth_day = datetime.date(birth_year, birth_month, birth_day)
today = datetime.date.today()
last_day = datetime.date(birth_day.year + target_year, birth_day.month, birth_day.day)
print last_day
print "Today", today - birth_day
print "Last day", last_day - today
if __name__ == '__main__':
print_days(birth_year=2013, birth_month=7, birth_day=22, target_year=80)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment