Date.java revision 0
2362N/A * Copyright 1996-2006 Sun Microsystems, Inc. All Rights Reserved. 817N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 817N/A * This code is free software; you can redistribute it and/or modify it 817N/A * under the terms of the GNU General Public License version 2 only, as 817N/A * published by the Free Software Foundation. Sun designates this 817N/A * particular file as subject to the "Classpath" exception as provided 817N/A * by Sun in the LICENSE file that accompanied this code. 817N/A * This code is distributed in the hope that it will be useful, but WITHOUT 817N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 817N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 817N/A * version 2 for more details (a copy is included in the LICENSE file that 817N/A * accompanied this code). 817N/A * You should have received a copy of the GNU General Public License version 817N/A * 2 along with this work; if not, write to the Free Software Foundation, 2362N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 2362N/A * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 817N/A * CA 95054 USA or visit www.sun.com if you need additional information or 817N/A * <P>A thin wrapper around a millisecond value that allows 817N/A * JDBC to identify this as an SQL <code>DATE</code> value. A 817N/A * milliseconds value represents the number of milliseconds that 817N/A * have passed since January 1, 1970 00:00:00.000 GMT. 817N/A * To conform with the definition of SQL <code>DATE</code>, the 817N/A * millisecond values wrapped by a <code>java.sql.Date</code> instance 817N/A * must be 'normalized' by setting the 817N/A * hours, minutes, seconds, and milliseconds to zero in the particular 817N/A * time zone with which the instance is associated. 817N/A * Constructs a <code>Date</code> object initialized with the given 817N/A * year, month, and day. 817N/A * The result is undefined if a given argument is out of bounds. 817N/A * @param year the year minus 1900; must be 0 to 8099. (Note that 817N/A * 8099 is 9999 minus 1900.) 817N/A * @deprecated instead use the constructor <code>Date(long date)</code> 817N/A * Constructs a <code>Date</code> object using the given milliseconds 817N/A * time value. If the given milliseconds value contains time 817N/A * information, the driver will set the time components to the 817N/A * time in the default time zone (the time zone of the Java virtual 817N/A * machine running the application) that corresponds to zero GMT. 817N/A * @param date milliseconds since January 1, 1970, 00:00:00 GMT not 817N/A * to exceed the milliseconds representation for the year 8099. 817N/A * A negative number indicates the number of milliseconds 817N/A * before January 1, 1970, 00:00:00 GMT. 817N/A // If the millisecond date value contains time info, mask it out. 817N/A * Sets an existing <code>Date</code> object 817N/A * using the given milliseconds time value. 817N/A * If the given milliseconds value contains time information, 817N/A * the driver will set the time components to the 817N/A * time in the default time zone (the time zone of the Java virtual 817N/A * machine running the application) that corresponds to zero GMT. 817N/A * @param date milliseconds since January 1, 1970, 00:00:00 GMT not 817N/A * to exceed the milliseconds representation for the year 8099. 817N/A * A negative number indicates the number of milliseconds 817N/A * before January 1, 1970, 00:00:00 GMT. 817N/A // If the millisecond date value contains time info, mask it out. 817N/A * Converts a string in JDBC date escape format to 1280N/A * a <code>Date</code> value. 817N/A * @param s a <code>String</code> object representing a date in 817N/A * in the format "yyyy-mm-dd" 817N/A * @return a <code>java.sql.Date</code> object representing the 817N/A * @throws IllegalArgumentException if the date given is not in the 817N/A * JDBC date escape format (yyyy-mm-dd) 1280N/A * Formats a date in the date escape format yyyy-mm-dd. 817N/A * @return a String in yyyy-mm-dd format // Override all the time operations inherited from java.util.Date; * This method is deprecated and should not be used because SQL Date * values do not have a time component. * @exception java.lang.IllegalArgumentException if this method is invoked * This method is deprecated and should not be used because SQL Date * values do not have a time component. * @exception java.lang.IllegalArgumentException if this method is invoked * This method is deprecated and should not be used because SQL Date * values do not have a time component. * @exception java.lang.IllegalArgumentException if this method is invoked * This method is deprecated and should not be used because SQL Date * values do not have a time component. * @exception java.lang.IllegalArgumentException if this method is invoked * This method is deprecated and should not be used because SQL Date * values do not have a time component. * @exception java.lang.IllegalArgumentException if this method is invoked * This method is deprecated and should not be used because SQL Date * values do not have a time component. * @exception java.lang.IllegalArgumentException if this method is invoked * Private serial version unique ID to ensure serialization