Skip to content

Commit

Permalink
(hopefully) parse times more correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
ianmcorvidae committed Sep 4, 2024
1 parent 5e3f6d7 commit 8fc67d2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ func SendWarningNotification(ctx context.Context, j *Job) error {
}

func SendPeriodicNotification(ctx context.Context, j *Job) error {
starttime, err := time.Parse(TimestampFromDBFormat, j.StartDate)
starttime, err := time.ParseInLocation(TimestampFromDBFormat, j.StartDate, time.Local)
if err != nil {
return errors.Wrapf(err, "failed to parse start date %s", j.StartDate)
}
Expand Down Expand Up @@ -302,7 +302,7 @@ func sendPeriodic(ctx context.Context, db *sql.DB, vicedb *VICEDatabaser) {
periodDuration = notifStatuses.PeriodicWarningPeriod
}

sd, err := time.Parse(TimestampFromDBFormat, j.StartDate)
sd, err := time.ParseInLocation(TimestampFromDBFormat, j.StartDate, time.Local)
if err != nil {
log.Error(errors.Wrapf(err, "Error parsing start date %s", j.StartDate))
continue
Expand Down

0 comments on commit 8fc67d2

Please sign in to comment.