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 @@ class Archive(object):
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']: