From: Neil Smith Date: Mon, 4 Apr 2016 13:25:43 +0000 (+0100) Subject: Timezone aware in standalone file X-Git-Url: https://git.njae.me.uk/?a=commitdiff_plain;h=1804dc85cd913ace36a9627f5ee3b956fb0ffe45;p=dmarc.git Timezone aware in standalone file --- diff --git a/dmarc_to_database b/dmarc_to_database index 530d548..ac7baa3 100755 --- a/dmarc_to_database +++ b/dmarc_to_database @@ -117,7 +117,7 @@ def build_insert_command(table_name, report, preamble_values=None, i=None): field_names += [field_maps[f]['pg_field_name']] if field_maps[f]['pg_type'] == 'int': values[field_maps[f]['pg_field_name']] = int(report.find(fp).text) - elif field_maps[f]['pg_type'] == 'timestamp': + elif field_maps[f]['pg_type'] == 'timestamptz': # values[field_maps[f]['pg_field_name']] = datetime.datetime.utcfromtimestamp(int(report.find(fp).text)) values[field_maps[f]['pg_field_name']] = \ datetime.datetime.fromtimestamp(int(report.find(fp).text),