📄 simpletimezone.html
字号:
<BR> Sets the DST start rule to a fixed date within a month.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../java/util/SimpleTimeZone.html#setStartRule(int, int, int, int)">setStartRule</A></B>(int month, int dayOfWeekInMonth, int dayOfWeek, int time)</CODE><BR> Sets the daylight savings starting rule.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../java/util/SimpleTimeZone.html#setStartRule(int, int, int, int, boolean)">setStartRule</A></B>(int month, int dayOfMonth, int dayOfWeek, int time, boolean after)</CODE><BR> Sets the DST start rule to a weekday before or after a give date within a month, e.g., the first Monday on or after the 8th.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../java/util/SimpleTimeZone.html#setStartYear(int)">setStartYear</A></B>(int year)</CODE><BR> Sets the daylight savings starting year.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="../../java/lang/String.html">String</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../java/util/SimpleTimeZone.html#toString()">toString</A></B>()</CODE><BR> Return a string representation of this time zone.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> boolean</CODE></FONT></TD><TD><CODE><B><A HREF="../../java/util/SimpleTimeZone.html#useDaylightTime()">useDaylightTime</A></B>()</CODE><BR> Overrides TimeZone Queries if this time zone uses Daylight Savings Time.</TD></TR></TABLE> <A NAME="methods_inherited_from_class_java.util.TimeZone"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"><TD><B>Methods inherited from class java.util.<A HREF="../../java/util/TimeZone.html">TimeZone</A></B></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><A HREF="../../java/util/TimeZone.html#getAvailableIDs()">getAvailableIDs</A>, <A HREF="../../java/util/TimeZone.html#getAvailableIDs(int)">getAvailableIDs</A>, <A HREF="../../java/util/TimeZone.html#getDefault()">getDefault</A>, <A HREF="../../java/util/TimeZone.html#getDisplayName()">getDisplayName</A>, <A HREF="../../java/util/TimeZone.html#getDisplayName(boolean, int)">getDisplayName</A>, <A HREF="../../java/util/TimeZone.html#getDisplayName(boolean, int, java.util.Locale)">getDisplayName</A>, <A HREF="../../java/util/TimeZone.html#getDisplayName(java.util.Locale)">getDisplayName</A>, <A HREF="../../java/util/TimeZone.html#getID()">getID</A>, <A HREF="../../java/util/TimeZone.html#getTimeZone(java.lang.String)">getTimeZone</A>, <A HREF="../../java/util/TimeZone.html#setDefault(java.util.TimeZone)">setDefault</A>, <A HREF="../../java/util/TimeZone.html#setID(java.lang.String)">setID</A></CODE></TD></TR></TABLE> <A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"><TD><B>Methods inherited from class java.lang.<A HREF="../../java/lang/Object.html">Object</A></B></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><A HREF="../../java/lang/Object.html#finalize()">finalize</A>, <A HREF="../../java/lang/Object.html#getClass()">getClass</A>, <A HREF="../../java/lang/Object.html#notify()">notify</A>, <A HREF="../../java/lang/Object.html#notifyAll()">notifyAll</A>, <A HREF="../../java/lang/Object.html#wait()">wait</A>, <A HREF="../../java/lang/Object.html#wait(long)">wait</A>, <A HREF="../../java/lang/Object.html#wait(long, int)">wait</A></CODE></TD></TR></TABLE> <P><!-- ============ FIELD DETAIL =========== --><!-- ========= CONSTRUCTOR DETAIL ======== --><A NAME="constructor_detail"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=1><FONT SIZE="+2"><B>Constructor Detail</B></FONT></TD></TR></TABLE><A NAME="SimpleTimeZone(int, java.lang.String)"><!-- --></A><H3>SimpleTimeZone</H3><PRE>public <B>SimpleTimeZone</B>(int rawOffset, <A HREF="../../java/lang/String.html">String</A> ID)</PRE><DL><DD>Constructs a SimpleTimeZone with the given base time zone offset from GMT and time zone ID. Timezone IDs can be obtained from TimeZone.getAvailableIDs. Normally you should use TimeZone.getDefault to construct a TimeZone.<DD><DL><DT><B>Parameters:</B><DD><CODE>rawOffset</CODE> - The given base time zone offset to GMT.<DD><CODE>ID</CODE> - The time zone ID which is obtained from TimeZone.getAvailableIDs.</DL></DD></DL><HR><A NAME="SimpleTimeZone(int, java.lang.String, int, int, int, int, int, int, int, int)"><!-- --></A><H3>SimpleTimeZone</H3><PRE>public <B>SimpleTimeZone</B>(int rawOffset, <A HREF="../../java/lang/String.html">String</A> ID, int startMonth, int startDay, int startDayOfWeek, int startTime, int endMonth, int endDay, int endDayOfWeek, int endTime)</PRE><DL><DD>Construct a SimpleTimeZone with the given base time zone offset from GMT, time zone ID, time to start and end the daylight time. Timezone IDs can be obtained from TimeZone.getAvailableIDs. Normally you should use TimeZone.getDefault to create a TimeZone. For a time zone that does not use daylight saving time, do not use this constructor; instead you should use SimpleTimeZone(rawOffset, ID). By default, this constructor specifies day-of-week-in-month rules. That is, if the startDay is 1, and the startDayOfWeek is SUNDAY, then this indicates the first Sunday in the startMonth. A startDay of -1 likewise indicates the last Sunday. However, by using negative or zero values for certain parameters, other types of rules can be specified. Day of month. To specify an exact day of the month, such as March 1, set startDayOfWeek to zero. Day of week after day of month. To specify the first day of the week occurring on or after an exact day of the month, make the day of the week negative. For example, if startDay is 5 and startDayOfWeek is -MONDAY, this indicates the first Monday on or after the 5th day of the startMonth. Day of week before day of month. To specify the last day of the week occurring on or before an exact day of the month, make the day of the week and the day of the month negative. For example, if startDay is -21 and startDayOfWeek is -WEDNESDAY, this indicates the last Wednesday on or before the 21st of the startMonth. The above examples refer to the startMonth, startDay, and startDayOfWeek; the same applies for the endMonth, endDay, and endDayOfWeek.<DD><DL><DT><B>Parameters:</B><DD><CODE>rawOffset</CODE> - The given base time zone offset to GMT.<DD><CODE>ID</CODE> - The time zone ID which is obtained from TimeZone.getAvailableIDs.<DD><CODE>startMonth</CODE> - The daylight savings starting month. Month is 0-based. eg, 0 for January.<DD><CODE>startDay</CODE> - The daylight savings starting day-of-week-in-month. Please see the member description for an example.<DD><CODE>startDayOfWeek</CODE> - The daylight savings starting day-of-week. Please see the member description for an example.<DD><CODE>startTime</CODE> - The daylight savings starting time in local wall time, which is standard time in this case. Please see the member description for an example.<DD><CODE>endMonth</CODE> - The daylight savings ending month. Month is 0-based. eg, 0 for January.<DD><CODE>endDay</CODE> - The daylight savings ending day-of-week-in-month. Please see the member description for an example.<DD><CODE>endDayOfWeek</CODE> - The daylight savings ending day-of-week. Please see the member description for an example.<DD><CODE>endTime</CODE> - The daylight savings ending time in local wall time, which is daylight time in this case. Please see the member description for an example.<DT><B>Throws:</B><DD><CODE><A HREF="../../java/lang/IllegalArgumentException.html">IllegalArgumentException</A></CODE> - the month, day, dayOfWeek, or time parameters are out of range for the start or end rule<DT><B>Since: </B><DD>JDK1.1</DD></DL></DD></DL><HR><A NAME="SimpleTimeZone(int, java.lang.String, int, int, int, int, int, int, int, int, int)"><!-- --></A><H3>SimpleTimeZone</H3><PRE>public <B>SimpleTimeZone</B>(int rawOffset, <A HREF="../../java/lang/String.html">String</A> ID, int startMonth, int startDay, int startDayOfWeek, int startTime, int endMonth, int endDay, int endDayOfWeek, int endTime, int dstSavings)</PRE><DL><DD>Constructor. This constructor is identical to the 10-argument constructor, but also takes a dstSavings parameter.<DD><DL><DT><B>Parameters:</B><DD><CODE>dstSavings</CODE> - The amount of time in ms saved during DST.<DT><B>Throws:</B><DD><CODE><A HREF="../../java/lang/IllegalArgumentException.html">IllegalArgumentException</A></CODE> - the month, day, dayOfWeek, or time parameters are out of range for the start or end rule<DT><B>Since: </B><DD>1.2</DD></DL></DD></DL><!-- ============ METHOD DETAIL ========== --><A NAME="method_detail"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=1><FONT SIZE="+2"><B>Method Detail</B></FONT></TD></TR></TABLE><A NAME="setStartYear(int)"><!-- --></A><H3>setStartYear</H3><PRE>public void <B>setStartYear</B>(int year)</PRE><DL><DD>Sets the daylight savings starting year.<DD><DL><DT><B>Parameters:</B><DD><CODE>year</CODE> - The daylight savings starting year.</DL></DD></DL><HR><A NAME="setStartRule(int, int, int, int)"><!-- --></A><H3>setStartRule</H3><PRE>public void <B>setStartRule</B>(int month, int dayOfWeekInMonth, int dayOfWeek, int time)</PRE><DL><DD>Sets the daylight savings starting rule. For example, Daylight Savings Time starts at the first Sunday in April, at 2 AM in standard time. Therefore, you can set the start rule by calling: setStartRule(TimeFields.APRIL, 1, TimeFields.SUNDAY, 2*60*60*1000);<DD><DL><DT><B>Parameters:</B><DD><CODE>month</CODE> - The daylight savings starting month. Month is 0-based. eg, 0 for January.<DD><CODE>dayOfWeekInMonth</CODE> - The daylight savings starting day-of-week-in-month. Please see the member description for an example.<DD><CODE>dayOfWeek</CODE> - The daylight savings starting day-of-week. Please see the member description for an example.<DD><CODE>time</CODE> - The daylight savings starting time in local wall time, which is standard time in this case. Please see the member description for an example.<DT><B>Throws:</B><DD><CODE><A HREF="../../java/lang/IllegalArgumentException.html">IllegalArgumentException</A></CODE> - the month, dayOfWeekInMonth, dayOfWeek, or time parameters are out of range</DL></DD></DL><HR><A NAME="setStartRule(int, int, int)"><!-- --></A><H3>setStartRule</H3><PRE>public void <B>setStartRule</B>(int month, int dayOfMonth, int time)</PRE><DL><DD>Sets the DST start rule to a fixed date within a month.<DD><DL><DT><B>Parameters:</B><DD><CODE>month</CODE> - The month in which this rule occurs (0-based).<DD><CODE>dayOfMonth</CODE> - The date in that month (1-based).<DD><CODE>time</CODE> - The time of that day (number of millis after midnight) when DST takes effect in local wall time, which is standard time in this case.<DT><B>Throws:</B><DD><CODE><A HREF="../../java/lang/IllegalArgumentException.html">IllegalArgumentException</A></CODE> - the month, dayOfMonth, or time parameters are out of range<DT><B>Since: </B><DD>1.2</DD></DL></DD></DL><HR><A NAME="setStartRule(int, int, int, int, boolean)"><!-- --></A><H3>setStartRule</H3><PRE>public void <B>setStartRule</B>(int month, int dayOfMonth, int dayOfWeek, int time, boolean after)</PRE><DL><DD>Sets the DST start rule to a weekday before or after a give date within a month, e.g., the first Monday on or after the 8th.<DD><DL><DT><B>Parameters:</B><DD><CODE>month</CODE> - The month in which this rule occurs (0-based).<DD><CODE>dayOfMonth</CODE> - A date within that month (1-based).<DD><CODE>dayOfWeek</CODE> - The day of the week on which this rule occurs.<DD><CODE>time</CODE> - The time of that day (number of millis after midnight) when DST takes effect in local wall time, which is standard time in this case.<DD><CODE>after</CODE> - If true, this rule selects the first dayOfWeek on or after dayOfMonth. If false, this rule selects the last dayOfWeek on or before dayOfMonth.<DT><B>Throws:</B><DD><CODE><A HREF="../../java/lang/IllegalArgumentException.html">IllegalArgumentException</A></CODE> - the month, dayOfMonth, dayOfWeek, or time parameters are out of range<DT><B>Since: </B><DD>1.2</DD></DL></DD></DL><HR><A NAME="setEndRule(int, int, int, int)"><!-- --></A><H3>setEndRule</H3><PRE>public void <B>setEndRule</B>(int month, int dayOfWeekInMonth, int dayOfWeek, int time)</PRE><DL><DD>Sets the daylight savings ending rule. For example, Daylight Savings Time ends at the last (-1) Sunday in October, at 2 AM in standard time. Therefore, you can set the end rule by calling: setEndRule(TimeFields.OCTOBER, -1, TimeFields.SUNDAY, 2*60*60*1000);<DD><DL><DT><B>Parameters:</B><DD><CODE>month</CODE> - The daylight savings ending month. Month is 0-based. eg, 0 for January.<DD><CODE>dayOfWeekInMonth</CODE> - The daylight savings ending day-of-week-in-month. Please see the member description for an example.<DD><CODE>dayOfWeek</CODE> - The daylight savings ending day-of-week. Please see the member description for an example.<DD><CODE>time</CODE> - The daylight savings ending time in local wall time, which is daylight time in this case. Please see the member description for an example.<DT><B>Throws:</B><DD><CODE><A HREF="../../java/lang/IllegalArgumentException.html">IllegalArgumentException</A></CODE> - the month, dayOfWeekInMonth, dayOfWeek, or time parameters are out of range</DL></DD></DL>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -