Switch to supported timezone since pytz suddenly ditched Pacific

File pomodoroprompt.py, line 56, in log_step
    timelog_file = Path(prepare_file(utc_start, ext='log', daily=True))
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File pomodoroprompt.py, line 100, in prepare_file
    logpath_tz = timezone('US/Pacific')
                 ^^^^^^^^^^^^^^^^^^^^^^

pytz.exceptions.UnknownTimeZoneError: 'US/Pacific'

Like i'm pretty sure it's right there on the coast but if calling it Los Angeles sooths you cool.
This commit is contained in:
benjamin melançon 2023-09-25 14:56:17 -04:00
parent 1d0c87e2ab
commit 0d39fb9e30

View file

@ -97,7 +97,7 @@ def prepare_file(utc_start, ext='csv', daily=False):
os.makedirs(logpath) os.makedirs(logpath)
# We consider 3am the switchover to a new day, so we skip extra math # We consider 3am the switchover to a new day, so we skip extra math
# and use Pacific time to get three hours later than our Eastern time. # and use Pacific time to get three hours later than our Eastern time.
logpath_tz = timezone('US/Pacific') logpath_tz = timezone('America/Los_Angeles')
logpath_date = utc_start.astimezone(logpath_tz) logpath_date = utc_start.astimezone(logpath_tz)
timelog_path = logpath + '/' + str(logpath_date.year); timelog_path = logpath + '/' + str(logpath_date.year);
if (daily): if (daily):