我用: utctime = datetime.datetime(1601,1,1) + datetime.timedelta(microseconds = tup[5]) last_visit_time = "Last visit time:"+ utctime.strftime('%Y-%m-%d %H:%M:%S')
在1900年前使用datetime.strftime()? ( 「規定年份> = 1900」)
但我有1601的時間,所以錯誤顯示: ValueError: year=1601 is before 1900; the datetime strftime() methods require year >= 1900
我使用python2.7,我怎樣才能使它?非常感謝!
您將需要一個外部庫。 mxDateTime確實可以追溯到第0年。http://www.egenix.com/products/python/mxBase/mxDateTime/doc/ – 2012-04-21 23:36:13