Postgresql: Timestamp without time zone not treated as UTC when the database is configured to be in UTC by default
See original GitHub issueThe value in the database is 2017-06-01 10:00:00
and I would expect to get 2017-06-01T10:00:00.000Z
, but instead KNEX treats the 10:00 as an hour in my server’s timezone (+3 GMT) and returns 2017-06-01T07:00:00.000Z
Issue Analytics
- State:
- Created 6 years ago
- Comments:9 (6 by maintainers)
Top Results From Across the Web
What is a valid use case for using TIMESTAMP WITHOUT ...
An input value that has an explicit time zone specified is converted to UTC using the appropriate offset for that time zone.
Read more >Difference between timestamps with/without time zone in ...
Without a time zone as part of the value, the obvious default time zone is UTC, so it is rendered for that time...
Read more >Documentation: 15: 8.5. Date/Time Types - PostgreSQL
When a timestamp with time zone value is output, it is always converted from UTC to the current timezone zone, and displayed as...
Read more >Mapping .NET Timestamps to PostgreSQL - Shay Rojansky
timestamptz is perhaps the worst-named type in the world: it does not, in fact, store a time zone in the database, but rather...
Read more >Actually Understanding Timezones in PostgreSQL - Untrod
Remember that Postgres doesn't store time zones; it just normalizes tz-aware timestamps to UTC. Know what time zone your session is using. It ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I ran into this issue also, and was able to get the behavior I expected by adding this code before creating a
knex
client object:I’ll report this to node-postgres and let’s see if they are willing to change how it works.