Think before you speak, read before you think.

python date相减

python 计算时间相差天数

from datetime import date

d0 = date(2008, 8, 18)
d1 = date(2008, 9, 26)
delta = d0 - d1
print delta.days

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *