Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-9283

Add timezone to cron expression

    XMLWordPrintable

    Details

    • Similar Issues:

      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

        Attachments

          Issue Links

            Activity

            robotfreak Clint Brown created issue -
            Hide
            scm_issue_link 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

            Show
            scm_issue_link 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
            Hide
            scm_issue_link 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

            Show
            scm_issue_link 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 Oleg Nenashev made changes -
            Field Original Value New Value
            Remote Link This issue links to "jenkins/pull/1672 (Web Link)" [ 12916 ]
            Hide
            c_brown 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.

            Show
            c_brown 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.
            Hide
            danielbeck 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).

            Show
            danielbeck 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).
            Hide
            c_brown 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....

            Show
            c_brown 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....
            Hide
            danielbeck 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.

            Show
            danielbeck 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.
            danielbeck Daniel Beck made changes -
            Status Open [ 1 ] Resolved [ 5 ]
            Resolution Fixed [ 1 ]
            rtyler R. Tyler Croy made changes -
            Workflow JNJira [ 139444 ] JNJira + In-Review [ 188502 ]
            Hide
            scm_issue_link 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

            Show
            scm_issue_link 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
            Hide
            scm_issue_link 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

            Show
            scm_issue_link 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
            Hide
            scm_issue_link 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

            Show
            scm_issue_link 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
            danielbeck Daniel Beck made changes -
            Labels lts-candidate
            Hide
            danielbeck Daniel Beck added a comment -

            Nominating the documentation fix for LTS inclusion.

            Show
            danielbeck Daniel Beck added a comment - Nominating the documentation fix for LTS inclusion.
            danielbeck Daniel Beck made changes -
            Issue Type New Feature [ 2 ] Bug [ 1 ]
            Hide
            danielbeck Daniel Beck added a comment -

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

            Show
            danielbeck Daniel Beck added a comment - Redeclaring this a bug (the missing documentation definitely was…) so it shows up in Oliver Gondža 's filter
            olivergondza Oliver Gondža made changes -
            Labels lts-candidate 2.60.2-fixed
            Hide
            scm_issue_link 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)

            Show
            scm_issue_link 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)

              People

              • Assignee:
                Unassigned
                Reporter:
                robotfreak Clint Brown
              • Votes:
                9 Vote for this issue
                Watchers:
                10 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: