我在任何地方都看不到它的记录,但是
time.mktime如果超出范围(包括负值,月份值),它将“滚动”到正确的年份:
x = 10now = time.localtime()print([time.localtime(time.mktime((now.tm_year, now.tm_mon - n, 1, 0, 0, 0, 0, 0, 0)))[:2] for n in range(x)])
欢迎分享,转载请注明来源:内存溢出
我在任何地方都看不到它的记录,但是
time.mktime如果超出范围(包括负值,月份值),它将“滚动”到正确的年份:
x = 10now = time.localtime()print([time.localtime(time.mktime((now.tm_year, now.tm_mon - n, 1, 0, 0, 0, 0, 0, 0)))[:2] for n in range(x)])
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)