1
0
mirror of https://github.com/kellyjonbrazil/jc.git synced 2025-06-17 00:07:37 +02:00

use new timestamp class

This commit is contained in:
Kelly Brazil
2021-04-01 11:23:24 -07:00
parent 638f879f16
commit c8655565ff

View File

@ -210,8 +210,9 @@ def process(proc_data):
if 'date' in entry:
# to speed up processing only try to convert the date if it's not the default format
if not re.match(r'[a-zA-Z]{3}\s{1,2}\d{1,2}\s{1,2}[0-9:]{4,5}', entry['date']):
entry['epoch'] = jc.utils.parse_datetime_to_timestamp(entry['date'])['timestamp_naive']
entry['epoch_utc'] = jc.utils.parse_datetime_to_timestamp(entry['date'])['timestamp_utc']
ts = jc.utils.timestamp(entry['date'])
entry['epoch'] = ts.naive
entry['epoch_utc'] = ts.utc
return proc_data