-
Does anyone know a way to correct this issue? I started SQLpage server with a connection to a MYSQL database. It all works great except when I use the MYSQL Now() function it returns the wrong time. UTC timezone instead of EST. The system time on the machine is correct, as well as the system time on the MYSQL settings and the MYSQL server. The now() function returns the correct time via every other connection I use. I see when I start SQLPage at the command line, that it shows the incorrect time. It should be: 2024-01-02T15:08:20.942 [2024-01-02T20:08:20.942Z INFO sqlpage::webserver::database::connect] Connecting to database: mysql://xxx:xxx@xxx/xx Right now I am using an easy fix of Now() -5 hours but I want to understand what is happening. Any help is appreciated. Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 4 replies
-
Hello and welcome to SQLPage! You can set the time zone on connection: You can create SET time_zone = 'America/New_York'; |
Beta Was this translation helpful? Give feedback.
-
Thanks! That worked for me. I had to use this as my on_connect.sql in my particular setup: SET @@SESSION.TIME_ZONE = "-5:00"; |
Beta Was this translation helpful? Give feedback.
Thanks! That worked for me. I had to use this as my on_connect.sql in my particular setup: