fix bug #21 on Windows

pull/23/head
deadc0de6 2 years ago
parent 797200f376
commit f49c5364cd

@ -319,7 +319,8 @@ class Noder:
out.append(utils.human(node.size)) # size
out.append(utils.epoch_to_str(storage.ts)) # indexed_at
out.append(utils.epoch_to_str(node.maccess)) # maccess
if self._has_attr(node, 'maccess'):
out.append(utils.epoch_to_str(node.maccess)) # maccess
if node.md5:
out.append(node.md5) # md5
else:

@ -52,6 +52,8 @@ def human(size):
def epoch_to_str(epoch):
'''convert epoch to string'''
if not epoch:
return ''
fmt = '%Y-%m-%d %H:%M:%S'
t = datetime.datetime.fromtimestamp(float(epoch))
return t.strftime(fmt)

Loading…
Cancel
Save