Timestamp¿¡ ¸Â¸Ô´Â °ÍÀ» »ç¿ëÇؾß...


[ ´ÙÀ½ ±Ûµé ] [ À̾ ±Û¿Ã¸®±â(´äÇϱâ) ] [ ÀÚ¹Ù ¹¯°í ´äÇϱâ ]

±Û¾´ÀÌ :¹ÚÂù¿ì 2000³â 5¿ù 01ÀÏ 20:56:38

In Reply to: DATEÇü Çʵ忡 °üÇØ posted by ¹ÚÁø¼º on 2000³â 5¿ù 01ÀÏ 15:51:36:

package java.sql;


/**
* <P>This class is a thin wrapper around java.util.Date that allows
* JDBC to identify this as a SQL TIMESTAMP value. It adds the ability
* to hold the SQL TIMESTAMP nanos value and provides formatting and
* parsing operations to support the JDBC escape syntax for timestamp
* values.
*
* <P><B>Note:</B> This type is a composite of a java.util.Date and a
* separate nanos value. Only integral seconds are stored in the
* <code>java.util.Date</code> component. The fractional seconds - the nanos - are
* separate. The <code>getTime</code> method will return only integral seconds. If
* a time value that includes the fractional seconds is desired, you
* must convert nanos to milliseconds (nanos/1000000) and add this to
* the <code>getTime</code> value. The
* <code>Timestamp.equals(Object)</code> method never returns
* true when passed a value of type <code>java.util.Date</code>
* because the nanos component of a date is unknown.
* As a result, the <code>Timestamp.equals(Object)</code>
* method is not symmetric with respect to the
* <code>java.util.Date.equals(Object)</code>
* method. Also, the <code>hashcode</code> method uses the underlying
* <code>java.util.Data</code>
* implementation and therefore does not include nanos in its computation.
*
* Due to the differences between the <code>Timestamp</code> class
* and the <code>java.util.Date</code>
* class mentioned above, it is recommended that code not view
* <code>Timestamp</code> values generically as an instance of
* <code>java.util.Date</code>. The
* inheritance relationship between <code>Timestamp</code>
* and <code>java.util.Date</code> really
* denotes implementation inheritance, and not type inheritance.
*/
public class Timestamp extends java.util.Date {


/**
* Constructs a <code>Timestamp</code> object initialized
* with the given values.
*
* @param year year-1900
* @param month 0 to 11
* @param day 1 to 31
* @param hour 0 to 23
* @param minute 0 to 59
* @param second 0 to 59
* @param nano 0 to 999,999,999
* @deprecated instead use the constructor <code>Timestamp(long millis)</code>
*/
public Timestamp(int year, int month, int date,
int hour, int minute, int second, int nano) {
super(year, month, date, hour, minute, second);
if (nano > 999999999 || nano < 0) {
throw new IllegalArgumentException("nanos > 999999999 or < 0");
}
nanos = nano;
}


/**
* Constructs a <code>Timestamp</code> object
* using a milliseconds time value. The
* integral seconds are stored in the underlying date value; the
* fractional seconds are stored in the <code>nanos</code> field of
* the <code>Timestamp</code> object.
*
* @param time milliseconds since January 1, 1970, 00:00:00 GMT.
* A negative number is the number of milliseconds before
* January 1, 1970, 00:00:00 GMT.
*/
public Timestamp(long time) {
super((time/1000)*1000);
nanos = (int)((time%1000) * 1000000);
if (nanos < 0) {
nanos = 1000000000 + nanos;
setTime(((time/1000)-1)*1000);
}
}


...
ÀÌÇÏ »ý·«



´ÙÀ½ ±Ûµé:



À̾ ±Û¿Ã¸®±â(´äÇϱâ)

À̸§:
E-Mail:
Á¦¸ñ:
³»¿ë:
HTML ÅÂ±× Æ÷ÇÔ ¿©ºÎ: HTML ¹®¼­ÀÏ °æ¿ì üũ
°ü·Ã URL(¼±ÅÃ):
URL Á¦¸ñ(¼±ÅÃ):
°ü·Ã À̹ÌÁö URL:


[ ´ÙÀ½ ±Ûµé ] [ À̾ ±Û¿Ã¸®±â(´äÇϱâ) ] [ ÀÚ¹Ù ¹¯°í ´äÇϱâ ]