Skip to content
Browse files

Merge pull request #2927 from daniel-beck/JENKINS-9283-docs

Document timezone specification and provide full list
  • Loading branch information...
oleg-nenashev committed Jul 1, 2017
2 parents bcf55ec + c906a18 commit 26fc2a9650b7ce5f2cd708444041ba88015e02ee
@@ -108,9 +108,9 @@ public static CronTabList create(@Nonnull String format, Hash hash) throws ANTLR
if(lineNumber == 1 && line.startsWith("TZ=")) {
timezone = getValidTimezone(line.replace("TZ=",""));
if(timezone != null) {
LOGGER.log(Level.CONFIG, "cron with timezone {0}", timezone);
LOGGER.log(Level.CONFIG, "CRON with timezone {0}", timezone);
} else {
LOGGER.log(Level.CONFIG, "invalid timezone {0}", line);
throw new ANTLRException("Invalid or unsupported timezone '" + timezone + "'");
@@ -1,3 +1,5 @@
<?jelly escape-by-default='true'?>
<j:jelly xmlns:j="jelly:core" xmlns:l="/lib/layout">
This field follows the syntax of cron (with minor differences).
Specifically, each line consists of 5 fields separated by TAB or whitespace:
@@ -80,4 +82,33 @@
# once a day on the 1st and 15th of every month except December
H H 1,15 1-11 *
<h3>Time zone specification</h3>
<j:invokeStatic className="java.util.TimeZone" method="getDefault" var="currentTimeZone"/>
Periodic tasks are normally executed at the scheduled time in the time zone of
the Jenkins master JVM (currently <strong>${currentTimeZone.getID()}</strong>).
This behavior can optionally be changed by specifying an alternative time zone in the
first line of the field.
Time zone specification starts with <code>TZ=</code>, followed by the ID of a time zone.
Complete example of a schedule with a time zone specification:
# This job needs to be run in the morning, London time
H 8 * * *
# Butlers do not have a five o'clock, so we run the job again
H(0-30) 17 * * *
The supported time zones depend on the Java runtime Jenkins is running on. The list of supported time zone IDs on this instance is:
<j:invokeStatic className="java.util.TimeZone" method="getAvailableIDs" var="timeZones"/>
<j:forEach items="${timeZones}" var="timeZone">

0 comments on commit 26fc2a9

Please sign in to comment.
You can’t perform that action at this time.