Add timezone to cron expression

Details

Description

It would be nice if the cron expression took an optional timezone, this way I could schedule jobs in New York or the UK relative to them, rather than converting to central time. Also, since UK and the US observe daylight saving at different times, I have to adjust jobs an hour until both have converged

Thanks. This works for the scheduling, but if you kick off a shell script that uses the date command, it still assumes the host/slaves timezone and returns the wrong value. You can set an export variable before launching the script: export TZ=/usr/share/zoneinfo/Europe/London which will do the right thing, but now has to be managed in multiple places. Perhaps adding a dropdown with zones to the config that you can select makes more sense. Then the cron trigger and shell build task can interrogate and do the right thing if set.

Clint Brown
added a comment - 2015-08-03 16:44 Thanks. This works for the scheduling, but if you kick off a shell script that uses the date command, it still assumes the host/slaves timezone and returns the wrong value. You can set an export variable before launching the script: export TZ=/usr/share/zoneinfo/Europe/London which will do the right thing, but now has to be managed in multiple places. Perhaps adding a dropdown with zones to the config that you can select makes more sense. Then the cron trigger and shell build task can interrogate and do the right thing if set.

IMO this looks like a really limited use case working around infra snafus (not to mention you didn't bring this up in the additional request). Additionally, I doubt any such magic would be expected by the majority of users as execution of any commands is entirely independent of scheduling in Jenkins, not to mention inconsistencies between various build steps (nothing but shell build step would support setting TZ this way).

Daniel Beck
added a comment - 2015-08-03 23:14 IMO this looks like a really limited use case working around infra snafus (not to mention you didn't bring this up in the additional request). Additionally, I doubt any such magic would be expected by the majority of users as execution of any commands is entirely independent of scheduling in Jenkins, not to mention inconsistencies between various build steps (nothing but shell build step would support setting TZ this way).