mirror of
https://github.com/internetarchive/warcprox.git
synced 2025-01-18 13:22:09 +01:00
make sure timestamp17(), which is part of warc name, always returns a 17 digit timestamp (even if millisecond part is <100)
This commit is contained in:
parent
8dfcf0401c
commit
67f2ceb717
@ -160,7 +160,7 @@ class WarcWriter:
|
|||||||
|
|
||||||
def timestamp17(self):
|
def timestamp17(self):
|
||||||
now = datetime.utcnow()
|
now = datetime.utcnow()
|
||||||
return '{}{}'.format(now.strftime('%Y%m%d%H%M%S'), now.microsecond//1000)
|
return '{:%Y%m%d%H%M%S}{:03d}'.format(now, now.microsecond//1000)
|
||||||
|
|
||||||
def close_writer(self):
|
def close_writer(self):
|
||||||
if self._fpath:
|
if self._fpath:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user