1
0
Fork 0
mirror of https://github.com/borgbackup/borg.git synced 2025-01-31 11:42:05 +00:00

Fix datetime parsing logic

This commit is contained in:
Jonas Borgström 2011-07-01 22:12:21 +02:00
parent 43cb73603b
commit 0f7d5a64a1

View file

@ -48,7 +48,7 @@ def load(self, id):
def ts(self):
"""Timestamp of archive creation in UTC"""
t, f = self.metadata['time'].split('.', 1)
return datetime.strptime(t, '%Y-%m-%dT%H:%M:%S') + timedelta(int(f) / 100)
return datetime.strptime(t, '%Y-%m-%dT%H:%M:%S') + timedelta(seconds=float('.' + f))
def get_chunks(self):
for id in self.metadata['chunks_ids']: