Write human-readable log in Eastern Time

This commit is contained in:
benjamin melançon 2020-07-15 10:09:58 -04:00
parent eeeb841a15
commit 168cc371cb

View file

@ -2,6 +2,7 @@ import csv
import time import time
from datetime import datetime, timedelta from datetime import datetime, timedelta
from pathlib import Path from pathlib import Path
from pytz import timezone
import pytz import pytz
import zenipy import zenipy
@ -49,7 +50,9 @@ def quit_prompt():
else: else:
quit_prompt() quit_prompt()
def log_step(text, start, end_section=False): def log_step(text, utc_start, end_section=False):
eastern = timezone('US/Eastern')
start = utc_start.astimezone(eastern)
timelog_path = 'log/' + str(start.year) + '-' + format(start.month, '02') + '-' + format(start.day, '02') + '.log' timelog_path = 'log/' + str(start.year) + '-' + format(start.month, '02') + '-' + format(start.day, '02') + '.log'
timelog_file = Path(timelog_path) timelog_file = Path(timelog_path)
timelog_file.touch(exist_ok=True) timelog_file.touch(exist_ok=True)