# Timezone settings?

**URL:** <https://discourse.nodered.org/t/timezone-settings/1176>\
**Category:** General\
**Created:** [29 June 2018 07:39 UTC](https://discourse.nodered.org/t/timezone-settings/1176 "2018-06-29T07:39:32Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![realjax](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/realjax/32/895_2.png) [@realjax](https://discourse.nodered.org/u/realjax)\
**Post date:** [29 June 2018 07:39 UTC](https://discourse.nodered.org/t/timezone-settings/1176/1 "2018-06-29T07:39:32Z")

</div>

Hi,

I have a function which includes a line similar to this  
`new Date(1530215497000)` (The epoch datestamp used here is an example)  
and al though the server on which Node-red runs is set to the correct timezone, it is not respected and (since I’m in GMT +2) is consistently 2 hours off.

What am I missing here or what else can I do to fix this?

cheers

---

<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:** [29 June 2018 08:57 UTC](https://discourse.nodered.org/t/timezone-settings/1176/2 "2018-06-29T08:57:06Z")

</div>

If you set the payload to that and pass it to a debug node what does it show and what do you expect it to show?  
Please copy/paste the complete string it shows or paste a screenshot.

---

<div class="post-metadata">

**Author:** ![ukmoose](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ukmoose/32/13_2.png) [@ukmoose](https://discourse.nodered.org/u/ukmoose)\
**Post date:** [29 June 2018 09:03 UTC](https://discourse.nodered.org/t/timezone-settings/1176/3 "2018-06-29T09:03:51Z")

</div>

What server are you running on?  
What version of node-red?  
What version of nodejs?

---

<div class="post-metadata">

**Author:** ![realjax](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/realjax/32/895_2.png) [@realjax](https://discourse.nodered.org/u/realjax)\
**Post date:** [29 June 2018 09:31 UTC](https://discourse.nodered.org/t/timezone-settings/1176/4 "2018-06-29T09:31:31Z")

</div>

Thanks!  
It shows this `2018-06-29T08:57:30.000Z` for `new Date(1530262650000)` and I would like it to say the correct time (as the Chrome console does when I run that same command) -\> `Fri Jun 29 2018 10:57:30 GMT+0200`

Running on ARMBIAN 5.38 stable Debian, latest Node-Red en node is v8.11.3

---

<div class="post-metadata">

**Author:** ![borpin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/borpin/32/1765_2.png) [@borpin](https://discourse.nodered.org/u/borpin)\
**Post date:** [29 June 2018 09:35 UTC](https://discourse.nodered.org/t/timezone-settings/1176/5 "2018-06-29T09:35:06Z")

</div>

This might help [https://www.digitalocean.com/community/tutorials/understanding-date-and-time-in-javascript](https://www.digitalocean.com/community/tutorials/understanding-date-and-time-in-javascript)

What do you get from `new Date()`?

---

<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:** [29 June 2018 09:47 UTC](https://discourse.nodered.org/t/timezone-settings/1176/6 "2018-06-29T09:47:29Z")

</div>

> [@realjax](#):
>
> It shows this `2018-06-29T08:57:30.000Z` for `new Date(1530262650000)` and I would like it to say the correct time (as the Chrome console does when I run that same command) -\> `Fri Jun 29 2018 10:57:30 GMT+0200`

Those two times are identical. The Z means it is showing it in UTC, the GMT+0200 means it is showing it in that timezone. It is just a matter of how you choose to display it, they are both the same time. If you want to display it on the dashboard (or elsewhere) in a particular or local timezone then you can use the Moment node to format it as you wish.

---

<div class="post-metadata">

**Author:** ![ukmoose](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ukmoose/32/13_2.png) [@ukmoose](https://discourse.nodered.org/u/ukmoose)\
**Post date:** [29 June 2018 09:48 UTC](https://discourse.nodered.org/t/timezone-settings/1176/7 "2018-06-29T09:48:28Z")

</div>

what does the command

> dpkg-reconfigure tzdata

return?

---

<div class="post-metadata">

**Author:** ![realjax](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/realjax/32/895_2.png) [@realjax](https://discourse.nodered.org/u/realjax)\
**Post date:** [29 June 2018 09:49 UTC](https://discourse.nodered.org/t/timezone-settings/1176/8 "2018-06-29T09:49:45Z")

</div>

> [@ukmoose](#):
>
> dpkg-reconfigure tzdata

A configuration utility. Set to Europe, Amsterdam.

---

<div class="post-metadata">

**Author:** ![realjax](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/realjax/32/895_2.png) [@realjax](https://discourse.nodered.org/u/realjax)\
**Post date:** [29 June 2018 09:50 UTC](https://discourse.nodered.org/t/timezone-settings/1176/9 "2018-06-29T09:50:40Z")

</div>

Thanks. So Node-Red provides no local timezone functionalities itself then?

---

<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:** [29 June 2018 09:52 UTC](https://discourse.nodered.org/t/timezone-settings/1176/10 "2018-06-29T09:52:46Z")

</div>

> [@realjax](#):
>
> A configuration utility. Set to Europe, Amsterdam.

That is interesting, I would have expected the debug node output to display in local time of, I think, the server, but perhaps it is the browser. Are you running the browser on the same machine as node-red?

---

<div class="post-metadata">

**Author:** ![zinen](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zinen/32/31659_2.png) [@zinen](https://discourse.nodered.org/u/zinen)\
**Post date:** [30 August 2020 15:21 UTC](https://discourse.nodered.org/t/timezone-settings/1176/12 "2020-08-30T15:21:25Z")

</div>

You can find more timezones here:  
[https://en.wikipedia.org/wiki/List\_of\_tz\_database\_time\_zones](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones)
