from datetime import date

import datetime
now = datetime.datetime.today()
birthday = datetime.datetime(1949, 10, 1)
age = now - birthday
print age.days


from datetime import date
now = date.today()
birthday = date(1949, 10, 1)
age = now - birthday
print age.days

计算建国的天数

库的引用,要了解库的结构啊。

你可能感兴趣的:(from datetime import date)