-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Parse date type as local time #514
Conversation
👍 Woot! |
Thank you so much @benighted Sorry for the delay here - going to try to get pg @ 3.0 out asap |
@brianc is there a way to set the timezone in node-postgres? I tried to find it in the documentation without success, i found an environment variable PGTZ here https://www.postgresql.org/docs/current/static/libpq-envars.html but i had not success trying to guess the configuration in the pool connection i.e. can you give me start point to solve this issue, maybe im not looking in the right place. Thanks in advance for your support |
@alejandrolsca generally you'd use something like -- Display the timestamp in the timezone of the object
select
orders.created_at at time zone orders.timezone
from orders |
@ jrf0110 I was aware of that way of doing it, so its not recommended to use SET timezone .....? at this moment looks like a good solution, but in the near future could i have some problems? scalability issues? just wonder, also still wondering why SET timezone .... did not work, even if you call that query in node postgres it gets overriden by postgres.conf? |
I believe set timezone = 'America/Chicago';
select now(); |
@jrf0110 well the problem here is that it doesn't work in node-postgres, at least not for me, if I execute those queries in DBMS it works, but not by doing it with node-postgres library as follows: |
Resolves issue #510, but is a breaking change. Handle with care 😄
Updated failing test case as well.