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

          Code changed in jenkins
          User: Oleg Nenashev
          Path:
          core/src/main/resources/hudson/triggers/TimerTrigger/help-spec.html
          http://jenkins-ci.org/commit/jenkins/b171bc60535dc2268f4c7f89a0daa6f9cc06febd
          Log:
          JENKINS-9283 - Document timezones support in help pages

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Oleg Nenashev Path: core/src/main/resources/hudson/triggers/TimerTrigger/help-spec.html http://jenkins-ci.org/commit/jenkins/b171bc60535dc2268f4c7f89a0daa6f9cc06febd Log: JENKINS-9283 - Document timezones support in help pages

          Code changed in jenkins
          User: Oleg Nenashev
          Path:
          core/src/main/java/hudson/scheduler/CronTabList.java
          core/src/main/resources/hudson/triggers/TimerTrigger/help-spec.html
          http://jenkins-ci.org/commit/jenkins/f6176bc19d6d62bb9dd20748af080fcb1cfd9976
          Log:
          JENKINS-9283 - Don't accept invalid timezones, add form validation

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Oleg Nenashev Path: core/src/main/java/hudson/scheduler/CronTabList.java core/src/main/resources/hudson/triggers/TimerTrigger/help-spec.html http://jenkins-ci.org/commit/jenkins/f6176bc19d6d62bb9dd20748af080fcb1cfd9976 Log: JENKINS-9283 - Don't accept invalid timezones, add form validation

          Code changed in jenkins
          User: Oleg Nenashev
          Path:
          core/src/main/java/hudson/scheduler/CronTabList.java
          core/src/main/resources/hudson/triggers/TimerTrigger/help-spec.html
          core/src/main/resources/hudson/triggers/TimerTrigger/help-spec.jelly
          http://jenkins-ci.org/commit/jenkins/26fc2a9650b7ce5f2cd708444041ba88015e02ee
          Log:
          Merge pull request #2927 from daniel-beck/JENKINS-9283-docs

          Document timezone specification and provide full list

          Compare: https://github.com/jenkinsci/jenkins/compare/bcf55ecd7f8a...26fc2a9650b7

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Oleg Nenashev Path: core/src/main/java/hudson/scheduler/CronTabList.java core/src/main/resources/hudson/triggers/TimerTrigger/help-spec.html core/src/main/resources/hudson/triggers/TimerTrigger/help-spec.jelly http://jenkins-ci.org/commit/jenkins/26fc2a9650b7ce5f2cd708444041ba88015e02ee Log: Merge pull request #2927 from daniel-beck/ JENKINS-9283 -docs Document timezone specification and provide full list Compare: https://github.com/jenkinsci/jenkins/compare/bcf55ecd7f8a...26fc2a9650b7

          Daniel Beck added a comment -

          Nominating the documentation fix for LTS inclusion.

          Daniel Beck added a comment - Nominating the documentation fix for LTS inclusion.

          Daniel Beck added a comment -

          Redeclaring this a bug (the missing documentation definitely was…) so it shows up in olivergondza's filter

          Daniel Beck added a comment - Redeclaring this a bug (the missing documentation definitely was…) so it shows up in olivergondza 's filter

          Code changed in jenkins
          User: Oleg Nenashev
          Path:
          core/src/main/java/hudson/scheduler/CronTabList.java
          core/src/main/resources/hudson/triggers/TimerTrigger/help-spec.html
          core/src/main/resources/hudson/triggers/TimerTrigger/help-spec.jelly
          http://jenkins-ci.org/commit/jenkins/beb63a2f5944ea63f128dfe0500b3b431c4b72f8
          Log:
          Merge pull request #2927 from daniel-beck/JENKINS-9283-docs

          Document timezone specification and provide full list

          (cherry picked from commit 26fc2a9650b7ce5f2cd708444041ba88015e02ee)

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Oleg Nenashev Path: core/src/main/java/hudson/scheduler/CronTabList.java core/src/main/resources/hudson/triggers/TimerTrigger/help-spec.html core/src/main/resources/hudson/triggers/TimerTrigger/help-spec.jelly http://jenkins-ci.org/commit/jenkins/beb63a2f5944ea63f128dfe0500b3b431c4b72f8 Log: Merge pull request #2927 from daniel-beck/ JENKINS-9283 -docs Document timezone specification and provide full list (cherry picked from commit 26fc2a9650b7ce5f2cd708444041ba88015e02ee)

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

              Created:
              Updated:
              Resolved: