Hi, I'm facing this problem without succeeding.
I have a project running on both Windows and Debian system. As database I use phpmyadmin, and in node-red this mysql node node-red-node-mysql (node) - Node-RED.
The problem is that node-red returns two different value, depending on the system it's running on.
I'll explain it better.
If I run in phpmyadmin GUI this command
SELECT @@global.time_zone, @@session.time_zone, NOW()
in the both OS I get
|@@global.time_zone|@@session.time_zone| NOW() | | +00:00 | +00:00 |2022-08-03 15:43:47|
Of course here NOW() returns UTC data, while mine local is +2
But if I pass this topic to mysql node
SELECT DateTime FROM MyTable ORDER BY DateTime DESC LIMIT 1
In Windows I get the correct value: like DateTime : "2022-06-07T07:00:00.000Z" which is in UTC. Infact in my local time it is 2022-06-07 09:00:00, as it is even visually shown in the GUI. So the result is correct.
While in Debian I get the wrong one, that means "2022-06-09T07:00:00.000Z" which is supposed to be in UTC but it actually is my local times. Infact it is the same as it is shown in the GUI: 2022-06-07 09:00:00
For what I know mysql always store timestamp in UTC and return it correctly converted in local time when queried.
Bytheway, in mysql DateTime is stored as timestamp type.