timestamps in utc!

This commit is contained in:
Noah Levitt 2014-08-01 16:00:53 -07:00
parent e79cdb84cb
commit ccbe3522c5
2 changed files with 5 additions and 4 deletions

View File

@ -42,6 +42,7 @@ setuptools.setup(name='warcprox',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.2',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
'Topic :: Internet :: Proxy Servers',
'Topic :: Internet :: WWW/HTTP',
'Topic :: Software Development :: Libraries :: Python Modules',

View File

@ -748,7 +748,7 @@ class WarcWriterThread(threading.Thread):
# returns a tuple (principal_record, request_record) where principal_record is either a response or revisit record
def build_warc_records(self, recorded_url):
warc_date = warctools.warc.warc_datetime_str(datetime.now())
warc_date = warctools.warc.warc_datetime_str(datetime.utcnow())
dedup_info = None
if self.dedup_db is not None and recorded_url.response_recorder.payload_digest is not None:
@ -802,7 +802,7 @@ class WarcWriterThread(threading.Thread):
refers_to_date=None):
if warc_date is None:
warc_date = warctools.warc.warc_datetime_str(datetime.now())
warc_date = warctools.warc.warc_datetime_str(datetime.utcnow())
record_id = warctools.WarcRecord.random_warc_uuid()
@ -851,7 +851,7 @@ class WarcWriterThread(threading.Thread):
def timestamp17(self):
now = datetime.now()
now = datetime.utcnow()
return '{}{}'.format(now.strftime('%Y%m%d%H%M%S'), now.microsecond//1000)
def _close_writer(self):
@ -865,7 +865,7 @@ class WarcWriterThread(threading.Thread):
self._f = None
def _build_warcinfo_record(self, filename):
warc_record_date = warctools.warc.warc_datetime_str(datetime.now())
warc_record_date = warctools.warc.warc_datetime_str(datetime.utcnow())
record_id = warctools.WarcRecord.random_warc_uuid()
headers = []