Python Cookbook学习记录 ch3_3/4_2013/10/29
摘要:
3.3 计算日期之间的时段给定两个日期,需要计算两个日期之间隔了几周感觉没有必要使用文中提到的dateutil模块,自己写了一段:>>> def totaltimer(times): td = datetime.timedelta(0) duration = sum([datetime.timedelta(minutes=x,seconds=y) for x,y in times],td) allseconds = duration.seconds print "The duration is "+str(int(allseconds/60))+" 阅读全文
posted @ 2013-10-29 22:20 七海之风 阅读(159) 评论(0) 推荐(0)
浙公网安备 33010602011771号