Unable to set default timezone
I am trying to set the default timezone but nothing seems to works
i have tried setting env variable and total config independently
$ TZ=Europe/Amsterdam node debug.js
AND
default-timezone : Europe/Kiev
AND
default-timezone : Europe/Amsterdam
but nothing works
Hmm, there is a problem in Node.js: https://stackoverflow.com/questions/8083410/how-can-i-set-the-default-timezone-in-node-js
Maybe this will work on Linux:
env TZ='Europe/Amsterdam' node server.js
But I don't recommend to change UTC, the work with UTC is better than some local timezone.
Well here the catch i am trying to make it utc time but it not working
UTC has great benefits:
- each client sends data in UTC format (JSON uses UTC time)
- client converts received dates in UTC to LocalTime automatically (JSON uses UTC time)
- time is universal between all continents
Yes i agree that's why we are trying to make new Date() object to always return utc time, currently its using the servers time instead of utc.
it's problem with yours OS. Node.js always using Tz settings, many OS use UTC format by default.
I think with code should work fine:
export TZ=utc
nodejs server.js
@webdesus i have tried that didnt work for us. And if its an OS issue, how can i fix it ?
Which OS you use?
windows 10 and centos 7 behaving same
I can not believe it. Do you can send me screen? This is my screen

Maybe you confused the client side with the backend side ...
@petersirka i think we can might close this issue, cuz It's not problem total.js
Yes, you're right.