mirror of
https://github.com/borgbackup/borg.git
synced 2025-02-22 06:01:54 +00:00
parent
7bacfa2d6e
commit
f3e9fa28bc
3 changed files with 5 additions and 4 deletions
1
CHANGES
1
CHANGES
|
@ -8,6 +8,7 @@ Version 0.9
|
|||
|
||||
(feature release, released on X)
|
||||
|
||||
- Fix incorrect display of time (#13)
|
||||
- Improved error handling / reporting. (#12)
|
||||
- Use fcntl() instead of flock() when locking repository/cache. (#15)
|
||||
- Let ssh figure out port/user if not specified so we don't override .ssh/config (#9)
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
from datetime import datetime, timedelta
|
||||
from datetime import datetime, timedelta, timezone
|
||||
from getpass import getuser
|
||||
from itertools import zip_longest
|
||||
import msgpack
|
||||
|
@ -122,7 +122,7 @@ def load(self, id):
|
|||
def ts(self):
|
||||
"""Timestamp of archive creation in UTC"""
|
||||
t, f = self.metadata[b'time'].split('.', 1)
|
||||
return datetime.strptime(t, '%Y-%m-%dT%H:%M:%S') + timedelta(seconds=float('.' + f))
|
||||
return datetime.strptime(t, '%Y-%m-%dT%H:%M:%S').replace(tzinfo=timezone.utc) + timedelta(seconds=float('.' + f))
|
||||
|
||||
def __repr__(self):
|
||||
return 'Archive(%r)' % self.name
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
import stat
|
||||
import sys
|
||||
import time
|
||||
from datetime import datetime, timedelta
|
||||
from datetime import datetime
|
||||
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 ts - timedelta(seconds=time.altzone)
|
||||
return datetime(*time.localtime(ts.timestamp())[:6])
|
||||
|
||||
|
||||
def adjust_patterns(paths, excludes):
|
||||
|
|
Loading…
Reference in a new issue