1
0
mirror of https://github.com/kellyjonbrazil/jc.git synced 2025-06-23 00:29:59 +02:00

only add timestamp field if datetime string is parsable

This commit is contained in:
Kelly Brazil
2024-02-04 11:56:41 -08:00
parent 8e5451a7c1
commit d209780a9d

@ -337,7 +337,9 @@ def _process(proc_data: List[JSONDictType]) -> List[JSONDictType]:
item[key] = jc.utils.convert_to_float(item[key])
if key in DT_HEADERS or key in DT_OR_STR_HEADERS:
item[key + '_epoch_utc'] = jc.utils.timestamp(item[key], format_hint=(3500,)).utc
timestamp = jc.utils.timestamp(item[key], format_hint=(3500,)).utc
if timestamp:
item[key + '_epoch_utc'] = timestamp
if key in DT_OR_INT_HEADERS:
timestamp = jc.utils.timestamp(item[key], format_hint=(3500,)).utc