3 ms·
I'm not sure what you mean by leveraging timezones. The SET TIMEZONE line was to simulate a fresh Postgres setup on my machine, which defaults to US/Pacific for
by hot_gril 3y ago
I'm not sure what you mean by leveraging timezones. The SET TIMEZONE line was to simulate a fresh Postgres setup on my machine, which defaults to US/Pacific for me. If my cluster is hosted elsewhere, idk what it defaults to. Postgres's built-in now() returns a timestamptz, and if I were instead inserting values from – say – JS w/ node-pg and using `new Date()`, I'd get the same behavior. I'm not going out of my way here.
If you're suggesting using timestamp rather than timestamptz, how do you do that without changing or assuming the DB's locale settings?