Today I was strugling with the node red ‘time range switch’. I noticed it was switching at a different time I intended. After some research I came to the conclusion the timezone setting for Node RED was wrong even with the server timezone set correctly.

After figuring out the root cause setting the timezone in NodeRED solved the issue. To change the timezone in NodeRED add the following line to ‘settings.js’ (located in ‘$home/.node-red’):

1
process.env.TZ = "Europe/Brussels";

One thought on “Setting the timezone in Node-RED

  1. Peter says:

    a msg.payload = new Date().toLocaleString(); in a function should report it as per the server time

    eg
    Sun Sep 21 2014 20:31:23 GMT+0100 (BST)

Leave a Reply

Your email address will not be published. Required fields are marked *

Name *
Email *
Website

This site uses Akismet to reduce spam. Learn how your comment data is processed.