码迷,mamicode.com
首页 > 其他好文 > 详细

datetime.timedelta

时间:2014-07-19 16:38:09      阅读:235      评论:0      收藏:0      [点我收藏+]

标签:2014   c   rom   date   port   Go   

from django.utils import timezone
import datetime

 

timezone.now()
datetime.datetime(2014, 7, 18, 9, 42, 24, 531000, tzinfo=<UTC>)

 

timezone.now() -datetime.timedelta(days=1)
2014-07-17 09:42:05.968000+00:00

 

print timezone.now() + datetime.timedelta(days=1)
2014-07-19 09:42:33.500000+00:00

 

timezone.now() - datetime.timedelta(days=5)
2014-07-13 09:43:02.140000+00:00

 

timezone.now() - datetime.timedelta(hours=5)
2014-07-18 04:45:17.859000+00:00

datetime.timedelta,布布扣,bubuko.com

datetime.timedelta

标签:2014   c   rom   date   port   Go   

原文地址:http://www.cnblogs.com/tuifeideyouran/p/3854035.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!