首页 > 代码库 > date

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

date