This is probably a very simple question, but it's hard to Google because it matches too many different questions.
I want to get the timezone (or offset) of timestamps saved in my database.
For example, right now in my database I have
expired_at
---------------------
2018-04-28 00:00:00
2018-03-28 08:00:00
2018-02-28 05:00:00
I want to find all expired_at
that has the PST offset.
So my pseudo-code would be something like this
SELECT expired_at FROM table WHERE expired_at IS IN TIMEZONE('PST')
Can I get some help. Thanks!
PS. Basically I am trying to fix a data integrity issue by finding all UTC timestamp and updating them to be PST. The database is screwed up right now with a mix of many different timezones.
TIMESTAMP WITHOUT TIMEZONE
), but rather should be a "doesn't care" situation; this is usually done by explicitly storing everything in UTC. The reasoning has to do with the fact that an event represents an actual, distinct, specific instant in time, and isn't really bound to any calendar.US/Pacific
orAmerica/Los_Angeles
.