📄 date.html
字号:
int day)</PRE><DL><DD><B>Deprecated.</B> <I>instead use the constructor <code>Date(long date)</code></I><P><DD>Constructs a <code>Date</code> object initialized with the given year, month, and day.<DD><DL><DT><B>Parameters:</B><DD><CODE>year</CODE> - year-1900<DD><CODE>month</CODE> - 0 to 11<DD><CODE>day</CODE> - 1 to 31</DL></DD></DL><HR><A NAME="Date(long)"><!-- --></A><H3>Date</H3><PRE>public <B>Date</B>(long date)</PRE><DL><DD>Constructs a <code>Date</code> object using a milliseconds time value. If the given millisecond value contains time information, the driver will set the time components to zero.<DD><DL><DT><B>Parameters:</B><DD><CODE>date</CODE> - milliseconds since January 1, 1970, 00:00:00 GMT.A negative number indicates the number of millisecondsbefore January 1, 1970, 00:00:00 GMT.</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="setTime(long)"><!-- --></A><H3>setTime</H3><PRE>public void <B>setTime</B>(long date)</PRE><DL><DD>Sets an existing <code>Date</code> object using the given milliseconds time value. If the given milliseconds value contains time information, the driver will set the time components to zero.<DD><DL><DT><B>Overrides:</B><DD><CODE><A HREF="../../java/util/Date.html#setTime(long)">setTime</A></CODE> in class <CODE><A HREF="../../java/util/Date.html">Date</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>date</CODE> - milliseconds since January 1, 1970, 00:00:00 GMT.A negative number indicates the number of millisecondsbefore January 1, 1970, 00:00:00 GMT.</DL></DD></DL><HR><A NAME="valueOf(java.lang.String)"><!-- --></A><H3>valueOf</H3><PRE>public static <A HREF="../../java/sql/Date.html">Date</A> <B>valueOf</B>(<A HREF="../../java/lang/String.html">String</A> s)</PRE><DL><DD>Converts a string in JDBC date escape format to a <code>Date</code> value.<DD><DL><DT><B>Parameters:</B><DD><CODE>s</CODE> - date in format "yyyy-mm-dd"<DT><B>Returns:</B><DD>a <code>Date</code> object representing the given date</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>Formats a date in the date escape format yyyy-mm-dd. <P> NOTE: To specify a date format for the class <code>SimpleDateFormat</code>, use "yyyy.MM.dd" rather than "yyyy-mm-dd". In the context of <code>SimpleDateFormat</code>, "mm" indicates minutes rather than the month. For example: <PRE> Format Pattern Result -------------- ------- "yyyy.MM.dd G 'at' hh:mm:ss z" ->> 1996.07.10 AD at 15:08:56 PDT </PRE><DD><DL><DT><B>Overrides:</B><DD><CODE><A HREF="../../java/util/Date.html#toString()">toString</A></CODE> in class <CODE><A HREF="../../java/util/Date.html">Date</A></CODE></DL></DD><DD><DL><DT><B>Returns:</B><DD>a String in yyyy-mm-dd format</DL></DD></DL><HR><A NAME="getHours()"><!-- --></A><H3>getHours</H3><PRE>public int <B>getHours</B>()</PRE><DL><DD><B>Deprecated.</B> <I></I> <P><DD>This method is deprecated and should not be used because SQL Date values do not have a time component.<DD><DL><DT><B>Overrides:</B><DD><CODE><A HREF="../../java/util/Date.html#getHours()">getHours</A></CODE> in class <CODE><A HREF="../../java/util/Date.html">Date</A></CODE></DL></DD><DD><DL><DT><B>Throws:</B><DD><CODE><A HREF="../../java/lang/IllegalArgumentException.html">IllegalArgumentException</A></CODE> - if this method is invoked</DL></DD></DL><HR><A NAME="getMinutes()"><!-- --></A><H3>getMinutes</H3><PRE>public int <B>getMinutes</B>()</PRE><DL><DD><B>Deprecated.</B> <I></I> <P><DD>This method is deprecated and should not be used because SQL Date values do not have a time component.<DD><DL><DT><B>Overrides:</B><DD><CODE><A HREF="../../java/util/Date.html#getMinutes()">getMinutes</A></CODE> in class <CODE><A HREF="../../java/util/Date.html">Date</A></CODE></DL></DD><DD><DL><DT><B>Throws:</B><DD><CODE><A HREF="../../java/lang/IllegalArgumentException.html">IllegalArgumentException</A></CODE> - if this method is invoked</DL></DD></DL><HR><A NAME="getSeconds()"><!-- --></A><H3>getSeconds</H3><PRE>public int <B>getSeconds</B>()</PRE><DL><DD><B>Deprecated.</B> <I></I> <P><DD>This method is deprecated and should not be used because SQL Date values do not have a time component.<DD><DL><DT><B>Overrides:</B><DD><CODE><A HREF="../../java/util/Date.html#getSeconds()">getSeconds</A></CODE> in class <CODE><A HREF="../../java/util/Date.html">Date</A></CODE></DL></DD><DD><DL><DT><B>Throws:</B><DD><CODE><A HREF="../../java/lang/IllegalArgumentException.html">IllegalArgumentException</A></CODE> - if this method is invoked</DL></DD></DL><HR><A NAME="setHours(int)"><!-- --></A><H3>setHours</H3><PRE>public void <B>setHours</B>(int i)</PRE><DL><DD><B>Deprecated.</B> <I></I> <P><DD>This method is deprecated and should not be used because SQL Date values do not have a time component.<DD><DL><DT><B>Overrides:</B><DD><CODE><A HREF="../../java/util/Date.html#setHours(int)">setHours</A></CODE> in class <CODE><A HREF="../../java/util/Date.html">Date</A></CODE></DL></DD><DD><DL><DT><B>Throws:</B><DD><CODE><A HREF="../../java/lang/IllegalArgumentException.html">IllegalArgumentException</A></CODE> - if this method is invoked</DL></DD></DL><HR><A NAME="setMinutes(int)"><!-- --></A><H3>setMinutes</H3><PRE>public void <B>setMinutes</B>(int i)</PRE><DL><DD><B>Deprecated.</B> <I></I> <P><DD>This method is deprecated and should not be used because SQL Date values do not have a time component.<DD><DL><DT><B>Overrides:</B><DD><CODE><A HREF="../../java/util/Date.html#setMinutes(int)">setMinutes</A></CODE> in class <CODE><A HREF="../../java/util/Date.html">Date</A></CODE></DL></DD><DD><DL><DT><B>Throws:</B><DD><CODE><A HREF="../../java/lang/IllegalArgumentException.html">IllegalArgumentException</A></CODE> - if this method is invoked</DL></DD></DL><HR><A NAME="setSeconds(int)"><!-- --></A><H3>setSeconds</H3><PRE>public void <B>setSeconds</B>(int i)</PRE><DL><DD><B>Deprecated.</B> <I></I> <P><DD>This method is deprecated and should not be used because SQL Date values do not have a time component.<DD><DL><DT><B>Overrides:</B><DD><CODE><A HREF="../../java/util/Date.html#setSeconds(int)">setSeconds</A></CODE> in class <CODE><A HREF="../../java/util/Date.html">Date</A></CODE></DL></DD><DD><DL><DT><B>Throws:</B><DD><CODE><A HREF="../../java/lang/IllegalArgumentException.html">IllegalArgumentException</A></CODE> - if this method is invoked</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/Date.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"> PREV CLASS <A HREF="../../java/sql/DriverManager.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="Date.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD></TR><TR><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY: INNER | FIELD | <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 + -