python 获取时间代码

        year = int(time.strftime('%Y', time.localtime()))
        month = int(time.strftime('%m', time.localtime()))
        day = int(time.strftime('%d', time.localtime()))
        now = datetime.date(year, month, day)
        week = now.isocalendar()[1]
week = now.isocalendar()[1]
得到当前第几周.
now.isocalendar()[2] 星期几

posted on 2013-01-28 13:30  foreveryl  阅读(294)  评论(0编辑  收藏  举报