From dd7ac8d78664cfd68d76f31bfa5aab3f42376b10 Mon Sep 17 00:00:00 2001 From: Bel LaPointe Date: Thu, 6 Jan 2022 21:28:44 -0500 Subject: [PATCH] parseinlocation for non utc crud --- pttodo/schedule.go | 2 +- pttodo/ts.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pttodo/schedule.go b/pttodo/schedule.go index 9593142..b5ef9d2 100644 --- a/pttodo/schedule.go +++ b/pttodo/schedule.go @@ -97,5 +97,5 @@ type scheduleEZDate string var scheduleEZDatePattern = regexp.MustCompile(`^[0-9]{4}-[0-9]{2}-[0-9]{2}$`) func (ezdate scheduleEZDate) next(time.Time) (time.Time, error) { - return time.Parse("2006-01-02", string(ezdate)) + return time.ParseInLocation("2006-01-02", string(ezdate), time.Local) } diff --git a/pttodo/ts.go b/pttodo/ts.go index d0cac52..e6c0d21 100644 --- a/pttodo/ts.go +++ b/pttodo/ts.go @@ -44,7 +44,7 @@ func (ts *TS) UnmarshalYAML(unmarshaller func(interface{}) error) error { } var s string if err := unmarshaller(&s); err == nil { - t, err := time.Parse(time.UnixDate, s) + t, err := time.ParseInLocation(time.UnixDate, s, time.Local) *ts = TS(t.Unix()) return err }