当前位置:编程学习 > 网站相关 >>

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  

 

计算建国的天数
库的引用,要了解库的结构啊。
补充:Web开发 , Python ,
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,