date

日期的处理

 

#! /usr/bin/env python  
#coding=utf-8  
  
import time  
import datetime  
  
d1 = datetime.datetime(2011, 2, 8)  
d2 = datetime.datetime(2010, 12, 31)  
  
print (d1 - d2).days  

 

 

参考:

http://www.wklken.me/posts/2015/03/03/python-base-datetime.html#2-date

http://justcoding.iteye.com/blog/901758

posted @ 2016-10-22 00:46  清源居士  阅读(270)  评论(0编辑  收藏  举报