浙江省高等学校教师教育理论培训

微信搜索“毛凌志岗前心得”小程序

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

#!/usr/bin/env python
#encoding="utf-8"
"""
free use navicat & sqlyog
"""
import datetime
from dateutil import parser
if __name__=="__main__":
    import sys,os
    if len(sys.argv)>1:
        import urllib2
        r=urllib2.urlopen("http://www.london2012.com/")
        t=r.headers.dict["date"]
        print t
        dt=parser.parse(t)
        dt=dt+datetime.timedelta(hours=8)//chage gmt datetime to gmt+8 area time
        print "%s-%s-%s %s:%s:%s"%(dt.year,dt.month,dt.day,dt.hour,dt.minute,dt.second)
        os.system("date %s-%s-%s"%(dt.year,dt.month,dt.day))
        os.system("time %s:%s:%s"%(dt.hour,dt.minute,dt.second))
        print "datetime back to normal %s"%datetime.datetime.now()
    else:
        os.system("date 2012-03-20")
        print "this is only for software expired used"
        print "datetime change to %s"%datetime.datetime.now()

posted on 2012-08-02 22:09  lexus  阅读(247)  评论(0编辑  收藏  举报