Skip to content

Commit b685fc5

Browse files
committed
更新日期转换
1 parent 733bf8c commit b685fc5

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

tools/date.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,9 @@ def test():
7272
print datetime.datetime.now().timetuple() # time.struct_time(tm_year=2015, tm_mon=9, tm_mday=7, tm_hour=22, tm_min=18, tm_sec=22, tm_wday=0, tm_yday=250, tm_isdst=-1)
7373
print type(datetime.datetime.now().timetuple()) # <type 'time.struct_time'>
7474

75+
# 字符串日期转星期(星期(0-6),星期天为星期的开始)
76+
print time.strftime('%w', time.strptime('2016-01-17', '%Y-%m-%d'))
77+
7578

7679
if __name__ == "__main__":
7780
test()

0 commit comments

Comments
 (0)