You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi everyone!
I’m using Neon in my Next.js application with chatbot and I store all of my date related data in UTC timezone. However, I’ve got a time when I want to retrieve all of my data in EST timezone. And I don’t want to specify it in query every time. I found a nice solution that seems great for me. I can set timezone for one connection specificaly with SET TIME ZONE 'EST';
I’m trying to do the same thing with Neon and my Next.js appliction. One thing is that I can’t understand where to place this logic. Is there anyone who can help with that?
Here’s the example of code that I was trying to use but it didn’t help
import { sql } from "@vercel/postgres";
sql.query("SET TIME ZONE 'EST'");
sql.query(MY_ACTUAL_QUERY);
sql.query("RESET TIME ZONE");
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi everyone!
I’m using Neon in my Next.js application with chatbot and I store all of my date related data in UTC timezone. However, I’ve got a time when I want to retrieve all of my data in EST timezone. And I don’t want to specify it in query every time. I found a nice solution that seems great for me. I can set timezone for one connection specificaly with
SET TIME ZONE 'EST';
I’m trying to do the same thing with Neon and my Next.js appliction. One thing is that I can’t understand where to place this logic. Is there anyone who can help with that?
Here’s the example of code that I was trying to use but it didn’t help
Beta Was this translation helpful? Give feedback.
All reactions