From 168cc371cbbc7e127d4150df744536bbd194c327 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?benjamin=20melan=C3=A7on?= Date: Wed, 15 Jul 2020 10:09:58 -0400 Subject: [PATCH] Write human-readable log in Eastern Time --- pomodoroprompt.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pomodoroprompt.py b/pomodoroprompt.py index c338f33..ea8bc68 100644 --- a/pomodoroprompt.py +++ b/pomodoroprompt.py @@ -2,6 +2,7 @@ import csv import time from datetime import datetime, timedelta from pathlib import Path +from pytz import timezone import pytz import zenipy @@ -49,7 +50,9 @@ def quit_prompt(): else: 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_file = Path(timelog_path) timelog_file.touch(exist_ok=True)