Skip to content

Commit

Permalink
Prefer ZoneInfo("UTC") to timezone.utc
Browse files Browse the repository at this point in the history
Co-authored-by: Nick <[email protected]>
  • Loading branch information
jsf9k and mcdonnnj committed Feb 25, 2024
1 parent 87661a0 commit b300f58
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
5 changes: 3 additions & 2 deletions src/pshtt_csv2mongo.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@

# Standard Python Libraries
import csv
from datetime import datetime, time, timezone
from datetime import datetime, time
import os
import re
from zoneinfo import ZoneInfo

# Third-Party Libraries
from mongo_db_from_config import db_from_config
Expand Down Expand Up @@ -103,7 +104,7 @@ def store_data(clean_federal, agency_dict, db_config_file):
:param db_config_file: The name of the file where the database
configuration is stored
"""
date_today = datetime.combine(datetime.now(timezone.utc), time.min)
date_today = datetime.combine(datetime.now(ZoneInfo("UTC")), time.min)
db = db_from_config(db_config_file) # set up database connection
f = open(PSHTT_RESULTS_FILE)
csv_f = csv.DictReader(f)
Expand Down
4 changes: 2 additions & 2 deletions src/sslyze_csv2mongo.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

# Standard Python Libraries
import csv
from datetime import datetime, time, timezone
from datetime import datetime, time
import os
from zoneinfo import ZoneInfo

Expand Down Expand Up @@ -103,7 +103,7 @@ def store_data(clean_federal, agency_dict, db_config_file):
:param db_config_file: The name of the file where the database
configuration is stored
"""
date_today = datetime.combine(datetime.now(timezone.utc), time.min)
date_today = datetime.combine(datetime.now(ZoneInfo("UTC")), time.min)
db = db_from_config(db_config_file) # set up database connection
f = open(SSLYZE_RESULTS_FILE)
csv_f = csv.DictReader(f)
Expand Down
5 changes: 3 additions & 2 deletions src/trustymail_csv2mongo.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@

# Standard Python Libraries
import csv
from datetime import datetime, time, timezone
from datetime import datetime, time
import os
from zoneinfo import ZoneInfo

# Third-Party Libraries
from mongo_db_from_config import db_from_config
Expand Down Expand Up @@ -101,7 +102,7 @@ def store_data(clean_federal, agency_dict, db_config_file):
:param db_config_file: The name of the file where the database
configuration is stored
"""
date_today = datetime.combine(datetime.now(timezone.utc), time.min)
date_today = datetime.combine(datetime.now(ZoneInfo("UTC")), time.min)
db = db_from_config(db_config_file) # set up database connection
f = open(TRUSTYMAIL_RESULTS_FILE)
csv_f = csv.DictReader(f)
Expand Down

0 comments on commit b300f58

Please sign in to comment.