fix utc_0
This commit is contained in:
parent
8d2875455d
commit
836ff68f4c
1 changed files with 4 additions and 1 deletions
|
@ -316,7 +316,10 @@ def remove_empty_tree(leaf):
|
||||||
else:
|
else:
|
||||||
break
|
break
|
||||||
|
|
||||||
utc_0 = int(time.mktime(datetime(1970, 1, 1).timetuple()))
|
try:
|
||||||
|
utc_0 = int(time.mktime(datetime(1970, 1, 1).timetuple()))
|
||||||
|
except:
|
||||||
|
utc_0 = int(time.mktime(time.gmtime()) - time.mktime(time.localtime()))
|
||||||
|
|
||||||
def datetime2ts(dt):
|
def datetime2ts(dt):
|
||||||
return int(time.mktime(dt.utctimetuple())) - utc_0
|
return int(time.mktime(dt.utctimetuple())) - utc_0
|
||||||
|
|
Loading…
Reference in a new issue