mirror of
https://github.com/borgbackup/borg.git
synced 2025-01-24 08:19:03 +00:00
Fix timezone issue on python 3.2
This commit is contained in:
parent
f3e9fa28bc
commit
87749e413e
1 changed files with 2 additions and 2 deletions
|
@ -8,7 +8,7 @@
|
|||
import stat
|
||||
import sys
|
||||
import time
|
||||
from datetime import datetime
|
||||
from datetime import datetime, timezone
|
||||
from fnmatch import fnmatchcase
|
||||
from operator import attrgetter
|
||||
import fcntl
|
||||
|
@ -138,7 +138,7 @@ def get_cache_dir():
|
|||
|
||||
def to_localtime(ts):
|
||||
"""Convert datetime object from UTC to local time zone"""
|
||||
return datetime(*time.localtime(ts.timestamp())[:6])
|
||||
return datetime(*time.localtime((ts - datetime(1970, 1, 1, tzinfo=timezone.utc)).total_seconds())[:6])
|
||||
|
||||
|
||||
def adjust_patterns(paths, excludes):
|
||||
|
|
Loading…
Reference in a new issue