Skip to content

switch to using utc everywhere#43

Merged
Jaden51 merged 3 commits into
mainfrom
utc
Mar 15, 2026
Merged

switch to using utc everywhere#43
Jaden51 merged 3 commits into
mainfrom
utc

Conversation

@Jaden51
Copy link
Copy Markdown
Contributor

@Jaden51 Jaden51 commented Mar 15, 2026

Description

#27
This PR gets rid of all of our pacific time conversions and stores time as UTC in the database.

Side note: this was actually causing a bug in our frontend because we would convert the time to pacific and store it in the database but we would never specific the location in postgres so it just serialized it as UTC. When we would then fetch the data from the frontend, it would return the pacific time but in UTC (in the future I guess) and then our frontend which has its time set to pacific would then turn this UTC time into pacific (in the past).

@Jaden51 Jaden51 changed the title use utc switch to using utc everywhere Mar 15, 2026
@Jaden51 Jaden51 requested review from bjzsh and joshhwuu March 15, 2026 19:08
Copy link
Copy Markdown
Member

@bjzsh bjzsh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I remember right, our current schema is using timestamp and date in various places. Neither of these are timezone-friendly. Can we include a migration to convert all of our date/time fields to timestamptz?

Comment thread internal/utils/time.go
return false, err
}

// Get start of day for both dates for proper date-only comparison
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it makes more sense to compare the timestamps directly (i.e. including hours/minutes/seconds). If we want to be precise, we can ensure that the value we write is at 00:00 UTC-7 instead: But we are already writing 00:00 UTC+0, which is fine.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I can include the migration, makes sense to me.

@Jaden51 Jaden51 merged commit 4ab0398 into main Mar 15, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants