From 9821ee623f220f677a717d997ca20f3b6db09b68 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?benjamin=20melan=C3=A7on?= Date: Tue, 27 Apr 2021 11:06:20 -0400 Subject: [PATCH] Very solid progress on manipulating the date --- pomodoro_to_harvest.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pomodoro_to_harvest.py b/pomodoro_to_harvest.py index 2da080a..f960831 100644 --- a/pomodoro_to_harvest.py +++ b/pomodoro_to_harvest.py @@ -3,3 +3,11 @@ import pandas as pd timelog = pd.read_csv("timelog-titled.csv") +timelog["started"] = pd.to_datetime(timelog["started"]) +timelog["recorded"] = pd.to_datetime(timelog["recorded"]) +timelog["time"] = 30 +# A pomodoro started before 3am Eastern time is considered to be a continuation +# of the day before, so we are, effectively, on West Coast time for determining +# the day we want to associate a time entry with. PomodoroPrompt saves as UTC. +timelog["date"] = timelog["started"].dt.tz_convert("US/Pacific").dt.date +timelog["day_of_week"] = timelog["day"].dt.day_name()