"Default" way to change timezone?
-
The host machine and servers generally are best to be run in UTC since they possibly serve users in various timezones. The apps itself, like the Cloudron dashboard and such should then translate from UTC to the local timezone (and locale formats) based on the user setting or browser profiles.
-
Yeah, I understand and that makes sense. Scheduled jobs are the only case in which this is kind of annoying, right? Since the container should still run in UTC, but then we should account for it when scheduling our jobs.
Maybe I'll just find another way to schedule the jobs, since a few of them need to be run in a specific time of day (on my TZ). I guess this would be the preferred approach? Because even if I account for the difference in hours and schedule them in UTC time, there's all kinds of specifics like daylight savings and the like that would make it kind of a nightmare...
Thanks anyway for the answers
-
Thanks for your help, @nebulon, but it seems that's not how it works. At least not on my cloudron.
I'm using a LAMP app, and the "Cron" item on its config page.This is how it looks:
# +------------------------ minute (0 - 59) # | +------------------- hour (0 - 23) # | | +-------------- day of month (1 - 31) # | | | +--------- month (1 - 12) # | | | | +---- day of week (0 - 6) (Sunday=0 or 7) # | | | | | # * * * * * command to be executed # * 7,8 * * 1-5 /app/data/latest/main.sh >> /app/data/app.log
It should fire at 7am and then again at 8am, on weekdays. And it's working, but it's 7 and 8am UTC, not on my timezone. And I've changed cloudron's system timezone to my local time.
-
You are right, just checked the code at https://git.cloudron.io/platform/box/-/blob/master/src/scheduler.js?ref_type=heads#L84 which sets up the cron job for the app. That does not specify the timezone, so it runs in UTC. In fact even our docs at https://docs.cloudron.io/apps/#cron mention this aspect correctly.
I confused the usage here myself, where the timezone only affects selected cron jobs like autoupdate and backups