Setting default timezone for glitch server


#1

Hi,

May i ask how to set the default timezone for my project? i tried go to terminal and set the timezone using tzselect but it seems to reset itself after sometime. Any solution to this? Thank you!


#2

You won’t be able to set the timezone permanently, because the server is restarted after it’s inactive for a while. It’s probably best to pass times from the server to the client in UTC, and then use the timezone on the client to display them to the user.

What exactly are you trying to do with dates/times?


#3

You could set the default timezone you want in Moment Timezone https://momentjs.com/timezone/ on the server.


#4

My server should be always on since there are always activity. However, the node-scheduler seems to not happy with tzselect and it is always triggered at UTC time instead of my local time.


#5

For scheduled tasks there are plenty of web cron services online. Just expose a route to trigger your task.