• Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • core

      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

          [JENKINS-9283] Add timezone to cron expression

          Clint Brown created issue -

          Code changed in jenkins
          User: Boris
          Path:
          core/src/main/java/hudson/scheduler/CronTab.java
          core/src/main/java/hudson/scheduler/CronTabList.java
          core/src/test/java/hudson/scheduler/CronTabTest.java
          http://jenkins-ci.org/commit/jenkins/6b4d044ae065c5abf515c48b37a990015ee1be24
          Log:
          JENKINS-9283 - Allow timezone definition in scheduler

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Boris Path: core/src/main/java/hudson/scheduler/CronTab.java core/src/main/java/hudson/scheduler/CronTabList.java core/src/test/java/hudson/scheduler/CronTabTest.java http://jenkins-ci.org/commit/jenkins/6b4d044ae065c5abf515c48b37a990015ee1be24 Log: JENKINS-9283 - Allow timezone definition in scheduler

          Code changed in jenkins
          User: Oleg Nenashev
          Path:
          core/src/main/java/hudson/scheduler/CronTab.java
          core/src/main/java/hudson/scheduler/CronTabList.java
          core/src/test/java/hudson/scheduler/CronTabTest.java
          http://jenkins-ci.org/commit/jenkins/73e151f3d1582b90a68e2f8c0e8bec0fbc042ee3
          Log:
          Merge pull request #1672 from productsupcom/JENKINS-9283

          JENKINS-9283 Timezone Support for Scheduling

          Compare: https://github.com/jenkinsci/jenkins/compare/5540e93f4a10...73e151f3d158

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Oleg Nenashev Path: core/src/main/java/hudson/scheduler/CronTab.java core/src/main/java/hudson/scheduler/CronTabList.java core/src/test/java/hudson/scheduler/CronTabTest.java http://jenkins-ci.org/commit/jenkins/73e151f3d1582b90a68e2f8c0e8bec0fbc042ee3 Log: Merge pull request #1672 from productsupcom/ JENKINS-9283 JENKINS-9283 Timezone Support for Scheduling Compare: https://github.com/jenkinsci/jenkins/compare/5540e93f4a10...73e151f3d158
          Oleg Nenashev made changes -
          Remote Link New: This issue links to "jenkins/pull/1672 (Web Link)" [ 12916 ]

          Clint Brown added a comment -

          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 - 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.

          Daniel Beck added a comment -

          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 - 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).

          Clint Brown added a comment -

          I didn't bring it up initially cause I didn't realize it was an issue until I actually tried it....

          Clint Brown added a comment - I didn't bring it up initially cause I didn't realize it was an issue until I actually tried it....

          Daniel Beck added a comment -

          This issue has been resolved a while ago.

          Features such as the one described in a recent comment should be filed independently.

          Daniel Beck added a comment - This issue has been resolved a while ago. Features such as the one described in a recent comment should be filed independently.
          Daniel Beck made changes -
          Resolution New: Fixed [ 1 ]
          Status Original: Open [ 1 ] New: Resolved [ 5 ]
          R. Tyler Croy made changes -
          Workflow Original: JNJira [ 139444 ] New: JNJira + In-Review [ 188502 ]

            Unassigned Unassigned
            robotfreak Clint Brown
            Votes:
            9 Vote for this issue
            Watchers:
            9 Start watching this issue

              Created:
              Updated:
              Resolved: