Mysql: different date Debian VS Windows

image

Debian
image

Windows
image

Is it possible that when the date/time was inserted into mysql, the timezone was different?

" MySQL converts TIMESTAMP values from the current time zone to UTC for storage, and back from UTC to the current time zone for retrieval. (This does not occur for other types such as DATETIME .) By default, the current time zone for each connection is the server's time. The time zone can be set on a per-connection basis. As long as the time zone setting remains constant, you get back the same value you store. If you store a TIMESTAMP value, and then change the time zone and retrieve the value, the retrieved value is different from the value you stored. This occurs because the same time zone was not used for conversion in both directions. The current time zone is available as the value of the time_zone system variable.

Your Debian system is on CEST which is UTC+2, but the Windows machine is set to UTC+1.

Where were you running the browser when you ran the flows? I meant you to run the browser on the machine running node-red, though I did not say that.

No, because it is enabled summer time. And if so we should have 1 hour as difference betwheen the result

I even thought this, but I've just made a test with a new data manually inserted, and nothing change. The behavior on both system doesn't change. Result is correctly shown in phpmyadmin but not in node-red

Yes, you are right.

On the Debian system, with the timestamp flow I posted, change the debug node to also output to the system console and see what you get in the node-red log.

I'm getting crazy!!!
I importd the DB from Debian to Windows. Nothing changed. I even made another test:
If, in node red, I use "SELECT UNIX_TIMESTAMP(DateTime)... " I got the correct result on Both system.
Not when I just use "SELECT DateTime ...." On Debian the result is always as already posted, the wrong one

@Colin I use it as service at boot, How can I show the debug window?

How did you install node-red? If you you installed using the recommended Debain/Pi/Ubuntu install script then you can use
node-red-log
If not then look in /var/log/syslog

[Edit] Or
sudo journalctl -f -u nodered

Debian
image
image

Windows
image
image

On Debian I noticed this message when node-red start.


So probably this is it. But How can I fix it?

DONE. Thanks so much. Looking at windows log I noticed that message. The problem was within the mysql config node. On debian I had "2", on windows nothing.

2 Likes

Glad you fixed it, I thought you were running the same flow on both.

No, they do different things, and at the end share result. But of course because of this problem nothing worked anymore. The problem rised after some update, If I'm not wrong mysql node even changed the way the result are passed as output.
Really thanks to all

Bytheway, yes I installed node-red using the recommended Debain/Pi/Ubuntu install script. But I use default node-red for testing and so on, while for production I use a dedicate instance that start as service on boot. How can I see it log windows? In order to make the previous test I stopped the service and started the instance via command line

Logs on Linux when started with systemd are visible via journalctl. They are also in the syslog but that is all mixed together. The journal can be restricted to a single service or multiple as needed. I think there is a node-red command that shows the log as well.

On Windows, the location of the logs depends on how node-red was run.

I don't know what you mean by that.

The install script provides a service file (nodered.service) that you can enable/start/stop using systemctl. Or you can use node-red-start to start the service and node-red-stop to stop it.

That depends on how you are running node red in Windows.