# Mysql: different date Debian VS Windows

**URL:** <https://discourse.nodered.org/t/mysql-different-date-debian-vs-windows/65983>\
**Category:** General\
**Created:** [3 August 2022 16:08 UTC](https://discourse.nodered.org/t/mysql-different-date-debian-vs-windows/65983 "2022-08-03T16:08:16Z")\
**Posts on this page:** 18\
**Page:** 2

<div class="post-metadata">

**Author:** ![Lupin\_III](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/lupin_iii/32/67650_2.png) [@Lupin\_III](https://discourse.nodered.org/u/Lupin_III)\
**Post date:** [5 August 2022 09:24 UTC](https://discourse.nodered.org/t/mysql-different-date-debian-vs-windows/65983/21 "2022-08-05T09:24:35Z")

</div>

> [@Colin](#):
>
> In the debian system what does this command show  
> `date`

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/5/c/5cf073d852bc3f1911fe0f8ce3d0524a19eaae67.png)

> [@Colin](#):
>
> In the windows system what do you see for the timezone in the system Date and Time settings?

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/f/4/f4bfe600eb77c5cbd42b1b0f5dc34563fadd4034.png)

> [@Colin](#):
>
> If you run this flow on each machine what do you see in the debug node?

Debian  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/a/1/a1b949ca9c332a43fe3f35a607cbe4da5bde8f3c.png)

Windows  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/8/3/83750a0fd9d56c11f325f1b36f9ba27a4f5ddb0c.png)

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [5 August 2022 09:39 UTC](https://discourse.nodered.org/t/mysql-different-date-debian-vs-windows/65983/22 "2022-08-05T09:39:55Z")

</div>

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`](https://dev.mysql.com/doc/refman/8.0/en/server-system-variables.html#sysvar_time_zone) system variable.

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [5 August 2022 10:00 UTC](https://discourse.nodered.org/t/mysql-different-date-debian-vs-windows/65983/23 "2022-08-05T10:00:53Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Lupin\_III](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/lupin_iii/32/67650_2.png) [@Lupin\_III](https://discourse.nodered.org/u/Lupin_III)\
**Post date:** [5 August 2022 10:03 UTC](https://discourse.nodered.org/t/mysql-different-date-debian-vs-windows/65983/24 "2022-08-05T10:03:05Z")

</div>

> [@Colin](#):
>
> Your Debian system is on CEST which is UTC+2, but the Windows machine is set to UTC+1

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

---

<div class="post-metadata">

**Author:** ![Lupin\_III](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/lupin_iii/32/67650_2.png) [@Lupin\_III](https://discourse.nodered.org/u/Lupin_III)\
**Post date:** [5 August 2022 10:05 UTC](https://discourse.nodered.org/t/mysql-different-date-debian-vs-windows/65983/25 "2022-08-05T10:05:59Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [5 August 2022 10:09 UTC](https://discourse.nodered.org/t/mysql-different-date-debian-vs-windows/65983/26 "2022-08-05T10:09:24Z")

</div>

> [@Lupin\_III](#):
>
> No, because it is enabled summer time.

Yes, you are right.

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [5 August 2022 10:14 UTC](https://discourse.nodered.org/t/mysql-different-date-debian-vs-windows/65983/27 "2022-08-05T10:14:34Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Lupin\_III](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/lupin_iii/32/67650_2.png) [@Lupin\_III](https://discourse.nodered.org/u/Lupin_III)\
**Post date:** [5 August 2022 10:26 UTC](https://discourse.nodered.org/t/mysql-different-date-debian-vs-windows/65983/28 "2022-08-05T10:26:43Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Lupin\_III](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/lupin_iii/32/67650_2.png) [@Lupin\_III](https://discourse.nodered.org/u/Lupin_III)\
**Post date:** [5 August 2022 10:27 UTC](https://discourse.nodered.org/t/mysql-different-date-debian-vs-windows/65983/29 "2022-08-05T10:27:58Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [5 August 2022 10:29 UTC](https://discourse.nodered.org/t/mysql-different-date-debian-vs-windows/65983/30 "2022-08-05T10:29:47Z")

</div>

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`

---

<div class="post-metadata">

**Author:** ![Lupin\_III](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/lupin_iii/32/67650_2.png) [@Lupin\_III](https://discourse.nodered.org/u/Lupin_III)\
**Post date:** [5 August 2022 10:54 UTC](https://discourse.nodered.org/t/mysql-different-date-debian-vs-windows/65983/31 "2022-08-05T10:54:01Z")

</div>

_ **Debian** _  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/e/d/edbb9cdc1f16128b74fd29a2d1c3565f1f21398c.png)  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/6/b/6bf3242d7b3be8c58877f2113cd8f1c13b374422.png)

**Windows**  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/b/3/b3576db189e438cb5564dd91e448581afc427db2.png)  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/2/c/2c5c4ec37f68ce309b8f68a5e4ed240fa1068717.png)

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

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/6/2/6239b2b1b4c8c80e0328d62bfca093183f02792b.png)  
So probably this is it. But How can I fix it?

---

<div class="post-metadata">

**Author:** ![Lupin\_III](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/lupin_iii/32/67650_2.png) [@Lupin\_III](https://discourse.nodered.org/u/Lupin_III)\
**Post date:** [5 August 2022 10:59 UTC](https://discourse.nodered.org/t/mysql-different-date-debian-vs-windows/65983/32 "2022-08-05T10:59:31Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [5 August 2022 11:18 UTC](https://discourse.nodered.org/t/mysql-different-date-debian-vs-windows/65983/33 "2022-08-05T11:18:33Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Lupin\_III](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/lupin_iii/32/67650_2.png) [@Lupin\_III](https://discourse.nodered.org/u/Lupin_III)\
**Post date:** [5 August 2022 14:21 UTC](https://discourse.nodered.org/t/mysql-different-date-debian-vs-windows/65983/34 "2022-08-05T14:21:59Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Lupin\_III](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/lupin_iii/32/67650_2.png) [@Lupin\_III](https://discourse.nodered.org/u/Lupin_III)\
**Post date:** [5 August 2022 14:34 UTC](https://discourse.nodered.org/t/mysql-different-date-debian-vs-windows/65983/35 "2022-08-05T14:34:08Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [5 August 2022 14:50 UTC](https://discourse.nodered.org/t/mysql-different-date-debian-vs-windows/65983/36 "2022-08-05T14:50:18Z")

</div>

> [@Lupin\_III](#):
>
> How can I see it log windows

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.

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [5 August 2022 14:50 UTC](https://discourse.nodered.org/t/mysql-different-date-debian-vs-windows/65983/37 "2022-08-05T14:50:37Z")

</div>

> [@Lupin\_III](#):
>
> I use default node-red for testing and so on

I don't know what you mean by that.

> [@Lupin\_III](#):
>
> for production I use a dedicate instance that start as service on boot

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.

> [@Lupin\_III](#):
>
> How can I see it log windows

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

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [19 August 2022 14:50 UTC](https://discourse.nodered.org/t/mysql-different-date-debian-vs-windows/65983/38 "2022-08-19T14:50:40Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.

[Previous page](https://discourse.nodered.org/t/mysql-different-date-debian-vs-windows/65983.md?page=1)
