📄 simpletimezone.html
字号:
<HR><A NAME="setEndRule(int, int, int)"><!-- --></A><H3>setEndRule</H3><PRE>public void <B>setEndRule</B>(int month, int dayOfMonth, int time)</PRE><DL><DD>Sets the DST end 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 ends in local wall time, which is daylight 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="setEndRule(int, int, int, int, boolean)"><!-- --></A><H3>setEndRule</H3><PRE>public void <B>setEndRule</B>(int month, int dayOfMonth, int dayOfWeek, int time, boolean after)</PRE><DL><DD>Sets the DST end 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 ends in local wall time, which is daylight 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="getOffset(int, int, int, int, int, int)"><!-- --></A><H3>getOffset</H3><PRE>public int <B>getOffset</B>(int era, int year, int month, int day, int dayOfWeek, int millis)</PRE><DL><DD>Returns the difference in milliseconds between local time and UTC, taking into account both the raw offset and the effect of daylight savings, for the specified date and time. This method assumes that the start and end month are distinct. It also uses a default <A HREF="../../java/util/GregorianCalendar.html"><CODE>GregorianCalendar</CODE></A> object as its underlying calendar, such as for determining leap years. Do not use the result of this method with a calendar other than a default <code>GregorianCalendar</code>. <p><em>Note: In general, clients should use <code>Calendar.get(ZONE_OFFSET) + Calendar.get(DST_OFFSET)</code> instead of calling this method.</em><DD><DL><DT><B>Overrides:</B><DD><CODE><A HREF="../../java/util/TimeZone.html#getOffset(int, int, int, int, int, int)">getOffset</A></CODE> in class <CODE><A HREF="../../java/util/TimeZone.html">TimeZone</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>era</CODE> - The era of the given date.<DD><CODE>year</CODE> - The year in the given date.<DD><CODE>month</CODE> - The month in the given date. Month is 0-based. e.g., 0 for January.<DD><CODE>day</CODE> - The day-in-month of the given date.<DD><CODE>dayOfWeek</CODE> - The day-of-week of the given date.<DD><CODE>millis</CODE> - The milliseconds in day in <em>standard</em> local time.<DT><B>Returns:</B><DD>The milliseconds to add to UTC to get local time.<DT><B>Throws:</B><DD><CODE><A HREF="../../java/lang/IllegalArgumentException.html">IllegalArgumentException</A></CODE> - the era, month, day, dayOfWeek, or millis parameters are out of range</DL></DD></DL><HR><A NAME="getRawOffset()"><!-- --></A><H3>getRawOffset</H3><PRE>public int <B>getRawOffset</B>()</PRE><DL><DD>Overrides TimeZone Gets the GMT offset for this time zone.<DD><DL><DT><B>Overrides:</B><DD><CODE><A HREF="../../java/util/TimeZone.html#getRawOffset()">getRawOffset</A></CODE> in class <CODE><A HREF="../../java/util/TimeZone.html">TimeZone</A></CODE></DL></DD><DD>Following copied from class: <CODE>java.util.TimeZone</CODE></DD><DD><DL><DT><B>Returns:</B><DD>the unmodified offset to add *to* UTC to get local time.</DL></DD></DL><HR><A NAME="setRawOffset(int)"><!-- --></A><H3>setRawOffset</H3><PRE>public void <B>setRawOffset</B>(int offsetMillis)</PRE><DL><DD>Overrides TimeZone Sets the base time zone offset to GMT. This is the offset to add *to* UTC to get local time. Please see TimeZone.setRawOffset for descriptions on the parameter.<DD><DL><DT><B>Overrides:</B><DD><CODE><A HREF="../../java/util/TimeZone.html#setRawOffset(int)">setRawOffset</A></CODE> in class <CODE><A HREF="../../java/util/TimeZone.html">TimeZone</A></CODE></DL></DD><DD>Following copied from class: <CODE>java.util.TimeZone</CODE></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>offsetMillis</CODE> - the given base time zone offset to GMT.</DL></DD></DL><HR><A NAME="setDSTSavings(int)"><!-- --></A><H3>setDSTSavings</H3><PRE>public void <B>setDSTSavings</B>(int millisSavedDuringDST)</PRE><DL><DD>Sets the amount of time in ms that the clock is advanced during DST.<DD><DL><DT><B>Parameters:</B><DD><CODE>millisSavedDuringDST</CODE> - the number of milliseconds the time is advanced with respect to standard time when the daylight savings rules are in effect. A positive number, typically one hour (3600000).<DT><B>Since: </B><DD>1.2</DD></DL></DD></DL><HR><A NAME="getDSTSavings()"><!-- --></A><H3>getDSTSavings</H3><PRE>public int <B>getDSTSavings</B>()</PRE><DL><DD>Returns the amount of time in ms that the clock is advanced during DST.<DD><DL><DT><B>Returns:</B><DD>the number of milliseconds the time is advanced with respect to standard time when the daylight savings rules are in effect. A positive number, typically one hour (3600000).<DT><B>Since: </B><DD>1.2</DD></DL></DD></DL><HR><A NAME="useDaylightTime()"><!-- --></A><H3>useDaylightTime</H3><PRE>public boolean <B>useDaylightTime</B>()</PRE><DL><DD>Overrides TimeZone Queries if this time zone uses Daylight Savings Time.<DD><DL><DT><B>Overrides:</B><DD><CODE><A HREF="../../java/util/TimeZone.html#useDaylightTime()">useDaylightTime</A></CODE> in class <CODE><A HREF="../../java/util/TimeZone.html">TimeZone</A></CODE></DL></DD><DD>Following copied from class: <CODE>java.util.TimeZone</CODE></DD><DD><DL><DT><B>Returns:</B><DD>true if this time zone uses daylight savings time, false, otherwise.</DL></DD></DL><HR><A NAME="inDaylightTime(java.util.Date)"><!-- --></A><H3>inDaylightTime</H3><PRE>public boolean <B>inDaylightTime</B>(<A HREF="../../java/util/Date.html">Date</A> date)</PRE><DL><DD>Overrides TimeZone Queries if the given date is in Daylight Savings Time.<DD><DL><DT><B>Overrides:</B><DD><CODE><A HREF="../../java/util/TimeZone.html#inDaylightTime(java.util.Date)">inDaylightTime</A></CODE> in class <CODE><A HREF="../../java/util/TimeZone.html">TimeZone</A></CODE></DL></DD><DD>Following copied from class: <CODE>java.util.TimeZone</CODE></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>date</CODE> - the given Date.<DT><B>Returns:</B><DD>true if the given date is in daylight savings time, false, otherwise.</DL></DD></DL><HR><A NAME="clone()"><!-- --></A><H3>clone</H3><PRE>public <A HREF="../../java/lang/Object.html">Object</A> <B>clone</B>()</PRE><DL><DD>Overrides Cloneable<DD><DL><DT><B>Overrides:</B><DD><CODE><A HREF="../../java/util/TimeZone.html#clone()">clone</A></CODE> in class <CODE><A HREF="../../java/util/TimeZone.html">TimeZone</A></CODE></DL></DD><DD>Following copied from class: <CODE>java.lang.Object</CODE></DD><DD><DL><DT><B>Returns:</B><DD>a clone of this instance.<DT><B>Throws:</B><DD><CODE><A HREF="../../java/lang/CloneNotSupportedException.html">CloneNotSupportedException</A></CODE> - if the object's class does not support the <code>Cloneable</code> interface. Subclasses that override the <code>clone</code> method can also throw this exception to indicate that an instance cannot be cloned.<DD><CODE><A HREF="../../java/lang/OutOfMemoryError.html">OutOfMemoryError</A></CODE> - if there is not enough memory.<DT><B>See Also: </B><DD><A HREF="../../java/lang/Cloneable.html"><CODE>Cloneable</CODE></A></DL></DD></DL><HR><A NAME="hashCode()"><!-- --></A><H3>hashCode</H3><PRE>public int <B>hashCode</B>()</PRE><DL><DD>Override hashCode. Generates the hash code for the SimpleDateFormat object<DD><DL><DT><B>Overrides:</B><DD><CODE><A HREF="../../java/lang/Object.html#hashCode()">hashCode</A></CODE> in class <CODE><A HREF="../../java/lang/Object.html">Object</A></CODE></DL></DD><DD>Following copied from class: <CODE>java.lang.Object</CODE></DD><DD><DL><DT><B>Returns:</B><DD>a hash code value for this object.<DT><B>See Also: </B><DD><A HREF="../../java/lang/Object.html#equals(java.lang.Object)"><CODE>Object.equals(java.lang.Object)</CODE></A>, <A HREF="../../java/util/Hashtable.html"><CODE>Hashtable</CODE></A></DL></DD></DL><HR><A NAME="equals(java.lang.Object)"><!-- --></A><H3>equals</H3><PRE>public boolean <B>equals</B>(<A HREF="../../java/lang/Object.html">Object</A> obj)</PRE><DL><DD>Compares the equality of two SimpleTimeZone objects.<DD><DL><DT><B>Overrides:</B><DD><CODE><A HREF="../../java/lang/Object.html#equals(java.lang.Object)">equals</A></CODE> in class <CODE><A HREF="../../java/lang/Object.html">Object</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>obj</CODE> - The SimpleTimeZone object to be compared with.<DT><B>Returns:</B><DD>True if the given obj is the same as this SimpleTimeZone object; false otherwise.</DL></DD></DL><HR><A NAME="hasSameRules(java.util.TimeZone)"><!-- --></A><H3>hasSameRules</H3><PRE>public boolean <B>hasSameRules</B>(<A HREF="../../java/util/TimeZone.html">TimeZone</A> other)</PRE><DL><DD>Return true if this zone has the same rules and offset as another zone.<DD><DL><DT><B>Overrides:</B><DD><CODE><A HREF="../../java/util/TimeZone.html#hasSameRules(java.util.TimeZone)">hasSameRules</A></CODE> in class <CODE><A HREF="../../java/util/TimeZone.html">TimeZone</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>other</CODE> - the TimeZone object to be compared with<DT><B>Returns:</B><DD>true if the given zone has the same rules and offset as this one<DT><B>Since: </B><DD>1.2</DD></DL></DD></DL><HR><A NAME="toString()"><!-- --></A><H3>toString</H3><PRE>public <A HREF="../../java/lang/String.html">String</A> <B>toString</B>()</PRE><DL><DD>Return a string representation of this time zone.<DD><DL><DT><B>Overrides:</B><DD><CODE><A HREF="../../java/lang/Object.html#toString()">toString</A></CODE> in class <CODE><A HREF="../../java/lang/Object.html">Object</A></CODE></DL></DD><DD><DL><DT><B>Returns:</B><DD>a string representation of this time zone.</DL></DD></DL><!-- ========= END OF CLASS DATA ========= --><HR><!-- ========== START OF NAVBAR ========== --><A NAME="navbar_bottom"><!-- --></A><TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0"><TR><TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"><A NAME="navbar_bottom_firstrow"><!-- --></A><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3"> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/SimpleTimeZone.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> </TR></TABLE></TD><TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM><b>Java<sup><font size=-2>TM</font></sup> 2 Platform<br>Std. Ed. v1.3</b></EM></TD></TR><TR><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../java/util/ResourceBundle.html"><B>PREV CLASS</B></A> <A HREF="../../java/util/Stack.html"><B>NEXT CLASS</B></A></FONT></TD><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../index.html" TARGET="_top"><B>FRAMES</B></A> <A HREF="SimpleTimeZone.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD></TR><TR><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY: INNER | <A HREF="#fields_inherited_from_class_java.util.TimeZone">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD></TR></TABLE><!-- =========== END OF NAVBAR =========== --><HR><font size="-1"><a href="http://java.sun.com/cgi-bin/bugreport.cgi">Submit a bug or feature</a><br>For further API reference and developer documentation, see <a href="http://java.sun.com/products/jdk/1.3/devdocs-vs-specs.html">Java 2 SDK SE Developer Documentation</a>. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples. <p>Java, Java 2D, and JDBC are trademarks or registered trademarks of Sun Microsystems, Inc. in the US and other countries.<br>Copyright 1993-2000 Sun Microsystems, Inc. 901 San Antonio Road<br>Palo Alto, California, 94303, U.S.A. All Rights Reserved.</font></BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -