提交 9635b724 编写于 作者: D Daniel Beck

Add list of supported time zone IDs, rephrase some of the doc

上级 f6176bc1
......@@ -110,7 +110,7 @@ public final class CronTabList {
if(timezone != null) {
LOGGER.log(Level.CONFIG, "CRON with timezone {0}", timezone);
} else {
throw new ANTLRException("Invalid or unsupported timezone '" + line + "'");
throw new ANTLRException("Invalid or unsupported timezone '" + timezone + "'");
}
continue;
}
......
<?jelly escape-by-default='true'?>
<j:jelly xmlns:j="jelly:core" xmlns:l="/lib/layout">
<div>
This field follows the syntax of cron (with minor differences).
Specifically, each line consists of 5 fields separated by TAB or whitespace:
......@@ -80,31 +82,33 @@ H H(9-16)/2 * * 1-5
# once a day on the 1st and 15th of every month except December
H H 1,15 1-11 *
</pre>
<h3>Timezone specification</h3>
<j:invokeStatic className="java.util.TimeZone" method="getDefault" var="currentTimeZone"/>
<p>
<b>Timezone specification</b>. <br/>
Periodic tasks are normally executed at the scheduled time in the timezone of
the Jenkins master JVM (currently Central European Time).
This behaviour can be <b>optionally</b> changed by specifying an alternative timezone in the
the Jenkins master JVM (currently <strong>${currentTimeZone.getID()}</strong>).
This behavior can optionally be changed by specifying an alternative timezone in the
first line of the field.
Timezone specification starts with <code>TZ=</code>, followed by the ID of a time zone.
</p>
<ul>
<li>Timezone specification should contain the &quot;TZ=$(timezoneID)&quot; string</li>
<li>If a timezone is not specified, the default Jenkins JVM timezone will be used</li>
<li>Th supports all timezones returned by
<a href="https://docs.oracle.com/javase/7/docs/api/java/util/TimeZone.html#getAvailableIDs()">
java.util.TimeZone::getAvailableIDs()
</a> on the Jenkins server JVM
</li>
<li>Examples: EST, Etc/GMT+5, US/Pacific, America/Indiana/Petersburg, etc.</li>
</ul>
<p>
Complete example of a schedule with a timezone specification:
</p>
<pre>
TZ=Europe/London
# 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 * * *
</pre>
<p>
Example:
The supported timezones depend on the Java runtime Jenkins is running on. The list of supported time zone IDs on this instance is:
</p>
<pre>
TZ=Europe/London
# 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 * * *
</pre>
<j:invokeStatic className="java.util.TimeZone" method="getAvailableIDs" var="timeZones"/>
<ul>
<j:forEach items="${timeZones}" var="timeZone">
<li>${timeZone}</li>
</j:forEach>
</ul>
</div>
</j:jelly>
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册