3261N/A * Copyright (c) 1994, 2010, Oracle and/or its affiliates. All rights reserved. 0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 0N/A * This code is free software; you can redistribute it and/or modify it 0N/A * under the terms of the GNU General Public License version 2 only, as 2362N/A * published by the Free Software Foundation. Oracle designates this 0N/A * particular file as subject to the "Classpath" exception as provided 2362N/A * by Oracle in the LICENSE file that accompanied this code. 0N/A * This code is distributed in the hope that it will be useful, but WITHOUT 0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 0N/A * version 2 for more details (a copy is included in the LICENSE file that 0N/A * accompanied this code). 0N/A * You should have received a copy of the GNU General Public License version 0N/A * 2 along with this work; if not, write to the Free Software Foundation, 0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 2362N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 2362N/A * or visit www.oracle.com if you need additional information or have any 0N/A * The class <code>Date</code> represents a specific instant 0N/A * in time, with millisecond precision. 0N/A * Prior to JDK 1.1, the class <code>Date</code> had two additional 0N/A * functions. It allowed the interpretation of dates as year, month, day, hour, 0N/A * minute, and second values. It also allowed the formatting and parsing 0N/A * of date strings. Unfortunately, the API for these functions was not 0N/A * amenable to internationalization. As of JDK 1.1, the 0N/A * <code>Calendar</code> class should be used to convert between dates and time 0N/A * fields and the <code>DateFormat</code> class should be used to format and 0N/A * parse date strings. 0N/A * The corresponding methods in <code>Date</code> are deprecated. 0N/A * Although the <code>Date</code> class is intended to reflect 0N/A * coordinated universal time (UTC), it may not do so exactly, 0N/A * depending on the host environment of the Java Virtual Machine. 0N/A * Nearly all modern operating systems assume that 1 day = 0N/A * 24 × 60 × 60 = 86400 seconds 0N/A * in all cases. In UTC, however, about once every year or two there 0N/A * is an extra second, called a "leap second." The leap 0N/A * second is always added as the last second of the day, and always 0N/A * on December 31 or June 30. For example, the last minute of the 0N/A * year 1995 was 61 seconds long, thanks to an added leap second. 0N/A * Most computer clocks are not accurate enough to be able to reflect 0N/A * the leap-second distinction. 0N/A * Some computer standards are defined in terms of Greenwich mean 0N/A * time (GMT), which is equivalent to universal time (UT). GMT is 0N/A * the "civil" name for the standard; UT is the 0N/A * "scientific" name for the same standard. The 0N/A * distinction between UTC and UT is that UTC is based on an atomic 0N/A * clock and UT is based on astronomical observations, which for all 0N/A * practical purposes is an invisibly fine hair to split. Because the 0N/A * earth's rotation is not uniform (it slows down and speeds up 0N/A * in complicated ways), UT does not always flow uniformly. Leap 0N/A * seconds are introduced as needed into UTC so as to keep UTC within 0N/A * 0.9 seconds of UT1, which is a version of UT with certain 0N/A * corrections applied. There are other time and date systems as 0N/A * well; for example, the time scale used by the satellite-based 0N/A * global positioning system (GPS) is synchronized to UTC but is 0N/A * <i>not</i> adjusted for leap seconds. An interesting source of 0N/A * further information is the U.S. Naval Observatory, particularly 0N/A * the Directorate of Time at: 0N/A * </pre></blockquote> 0N/A * and their definitions of "Systems of Time" at: 0N/A * </pre></blockquote> 0N/A * In all methods of class <code>Date</code> that accept or return 0N/A * year, month, date, hours, minutes, and seconds values, the 0N/A * following representations are used: 0N/A * <li>A year <i>y</i> is represented by the integer 0N/A * <i>y</i> <code>- 1900</code>. 0N/A * <li>A month is represented by an integer from 0 to 11; 0 is January, 0N/A * 1 is February, and so forth; thus 11 is December. 0N/A * <li>A date (day of month) is represented by an integer from 1 to 31 0N/A * in the usual manner. 0N/A * <li>An hour is represented by an integer from 0 to 23. Thus, the hour 0N/A * from midnight to 1 a.m. is hour 0, and the hour from noon to 1 0N/A * <li>A minute is represented by an integer from 0 to 59 in the usual manner. 0N/A * <li>A second is represented by an integer from 0 to 61; the values 60 and 0N/A * 61 occur only for leap seconds and even then only in Java 0N/A * implementations that actually track leap seconds correctly. Because 0N/A * of the manner in which leap seconds are currently introduced, it is 0N/A * extremely unlikely that two leap seconds will occur in the same 0N/A * minute, but this specification follows the date and time conventions 0N/A * In all cases, arguments given to methods for these purposes need 0N/A * not fall within the indicated ranges; for example, a date may be 0N/A * specified as January 32 and is interpreted as meaning February 1. 0N/A * @author James Gosling 0N/A * @author Arthur van Hoff 0N/A * @see java.text.DateFormat 0N/A * @see java.util.Calendar 0N/A * @see java.util.TimeZone 0N/A * If cdate is null, then fastTime indicates the time in millis. 0N/A * If cdate.isNormalized() is true, then fastTime and cdate are in 0N/A * synch. Otherwise, fastTime is ignored, and cdate indicates the 0N/A // Initialized just before the value is used. See parse(). 0N/A /* use serialVersionUID from modified java.util.Date for 0N/A * interoperability with JDK1.1. The Date was modified to write 0N/A * and read only the UTC time. 0N/A * Allocates a <code>Date</code> object and initializes it so that 0N/A * it represents the time at which it was allocated, measured to the 0N/A * nearest millisecond. 0N/A * @see java.lang.System#currentTimeMillis() 0N/A * Allocates a <code>Date</code> object and initializes it to 0N/A * represent the specified number of milliseconds since the 0N/A * standard base time known as "the epoch", namely January 1, 0N/A * 1970, 00:00:00 GMT. 0N/A * @param date the milliseconds since January 1, 1970, 00:00:00 GMT. 0N/A * @see java.lang.System#currentTimeMillis() 0N/A * Allocates a <code>Date</code> object and initializes it so that 0N/A * it represents midnight, local time, at the beginning of the day 0N/A * specified by the <code>year</code>, <code>month</code>, and 0N/A * <code>date</code> arguments. 0N/A * @param year the year minus 1900. 0N/A * @param month the month between 0-11. 0N/A * @param date the day of the month between 1-31. 0N/A * @see java.util.Calendar 0N/A * @deprecated As of JDK version 1.1, 0N/A * replaced by <code>Calendar.set(year + 1900, month, date)</code> 0N/A * or <code>GregorianCalendar(year + 1900, month, date)</code>. 0N/A * Allocates a <code>Date</code> object and initializes it so that 0N/A * it represents the instant at the start of the minute specified by 0N/A * the <code>year</code>, <code>month</code>, <code>date</code>, 0N/A * <code>hrs</code>, and <code>min</code> arguments, in the local 0N/A * @param year the year minus 1900. 0N/A * @param month the month between 0-11. 0N/A * @param date the day of the month between 1-31. 0N/A * @param hrs the hours between 0-23. 0N/A * @param min the minutes between 0-59. 0N/A * @see java.util.Calendar 0N/A * @deprecated As of JDK version 1.1, 0N/A * replaced by <code>Calendar.set(year + 1900, month, date, 0N/A * hrs, min)</code> or <code>GregorianCalendar(year + 1900, 0N/A * month, date, hrs, min)</code>. 0N/A * Allocates a <code>Date</code> object and initializes it so that 0N/A * it represents the instant at the start of the second specified 0N/A * by the <code>year</code>, <code>month</code>, <code>date</code>, 0N/A * <code>hrs</code>, <code>min</code>, and <code>sec</code> arguments, 0N/A * in the local time zone. 0N/A * @param year the year minus 1900. 0N/A * @param month the month between 0-11. 0N/A * @param date the day of the month between 1-31. 0N/A * @param hrs the hours between 0-23. 0N/A * @param min the minutes between 0-59. 0N/A * @param sec the seconds between 0-59. 0N/A * @see java.util.Calendar 0N/A * @deprecated As of JDK version 1.1, 0N/A * replaced by <code>Calendar.set(year + 1900, month, date, 0N/A * hrs, min, sec)</code> or <code>GregorianCalendar(year + 1900, 0N/A * month, date, hrs, min, sec)</code>. 0N/A // month is 0-based. So we have to normalize month to support Long.MAX_VALUE. 0N/A * Allocates a <code>Date</code> object and initializes it so that 0N/A * it represents the date and time indicated by the string 0N/A * <code>s</code>, which is interpreted as if by the 0N/A * {@link Date#parse} method. 0N/A * @param s a string representation of the date. 0N/A * @see java.text.DateFormat 0N/A * @see java.util.Date#parse(java.lang.String) 0N/A * @deprecated As of JDK version 1.1, 0N/A * replaced by <code>DateFormat.parse(String s)</code>. 0N/A * Return a copy of this object. 0N/A * Determines the date and time based on the arguments. The 0N/A * arguments are interpreted as a year, month, day of the month, 0N/A * hour of the day, minute within the hour, and second within the 0N/A * minute, exactly as for the <tt>Date</tt> constructor with six 0N/A * arguments, except that the arguments are interpreted relative 0N/A * to UTC rather than to the local time zone. The time indicated is 0N/A * returned represented as the distance, measured in milliseconds, 0N/A * of that time from the epoch (00:00:00 GMT on January 1, 1970). 0N/A * @param year the year minus 1900. 0N/A * @param month the month between 0-11. 0N/A * @param date the day of the month between 1-31. 0N/A * @param hrs the hours between 0-23. 0N/A * @param min the minutes between 0-59. 0N/A * @param sec the seconds between 0-59. 0N/A * @return the number of milliseconds since January 1, 1970, 00:00:00 GMT for 0N/A * the date and time specified by the arguments. 0N/A * @see java.util.Calendar 0N/A * @deprecated As of JDK version 1.1, 0N/A * replaced by <code>Calendar.set(year + 1900, month, date, 0N/A * hrs, min, sec)</code> or <code>GregorianCalendar(year + 1900, 0N/A * month, date, hrs, min, sec)</code>, using a UTC 0N/A * <code>TimeZone</code>, followed by <code>Calendar.getTime().getTime()</code>. 0N/A // month is 0-based. So we have to normalize month to support Long.MAX_VALUE. 0N/A // Use a Date instance to perform normalization. Its fastTime 0N/A // is the UTC value after the normalization. 0N/A * Attempts to interpret the string <tt>s</tt> as a representation 0N/A * of a date and time. If the attempt is successful, the time 0N/A * indicated is returned represented as the distance, measured in 0N/A * milliseconds, of that time from the epoch (00:00:00 GMT on 0N/A * January 1, 1970). If the attempt fails, an 0N/A * <tt>IllegalArgumentException</tt> is thrown. 0N/A * It accepts many syntaxes; in particular, it recognizes the IETF 0N/A * standard date syntax: "Sat, 12 Aug 1995 13:30:00 GMT". It also 0N/A * understands the continental U.S. time-zone abbreviations, but for 0N/A * general use, a time-zone offset should be used: "Sat, 12 Aug 1995 0N/A * 13:30:00 GMT+0430" (4 hours, 30 minutes west of the Greenwich 0N/A * meridian). If no time zone is specified, the local time zone is 0N/A * assumed. GMT and UTC are considered equivalent. 0N/A * The string <tt>s</tt> is processed from left to right, looking for 0N/A * data of interest. Any material in <tt>s</tt> that is within the 0N/A * ASCII parenthesis characters <tt>(</tt> and <tt>)</tt> is ignored. 0N/A * Parentheses may be nested. Otherwise, the only characters permitted 0N/A * within <tt>s</tt> are these ASCII characters: 0N/A * abcdefghijklmnopqrstuvwxyz 0N/A * ABCDEFGHIJKLMNOPQRSTUVWXYZ 0N/A * 0123456789,+-:/</pre></blockquote> 0N/A * and whitespace characters.<p> 0N/A * A consecutive sequence of decimal digits is treated as a decimal 0N/A * <li>If a number is preceded by <tt>+</tt> or <tt>-</tt> and a year 0N/A * has already been recognized, then the number is a time-zone 0N/A * offset. If the number is less than 24, it is an offset measured 0N/A * in hours. Otherwise, it is regarded as an offset in minutes, 0N/A * expressed in 24-hour time format without punctuation. A 0N/A * preceding <tt>-</tt> means a westward offset. Time zone offsets 0N/A * are always relative to UTC (Greenwich). Thus, for example, 0N/A * <tt>-5</tt> occurring in the string would mean "five hours west 0N/A * of Greenwich" and <tt>+0430</tt> would mean "four hours and 0N/A * thirty minutes east of Greenwich." It is permitted for the 0N/A * string to specify <tt>GMT</tt>, <tt>UT</tt>, or <tt>UTC</tt> 0N/A * redundantly-for example, <tt>GMT-5</tt> or <tt>utc+0430</tt>. 0N/A * <li>The number is regarded as a year number if one of the 0N/A * following conditions is true: 0N/A * <li>The number is equal to or greater than 70 and followed by a 0N/A * space, comma, slash, or end of string 0N/A * <li>The number is less than 70, and both a month and a day of 0N/A * the month have already been recognized</li> 0N/A * If the recognized year number is less than 100, it is 0N/A * interpreted as an abbreviated year relative to a century of 0N/A * which dates are within 80 years before and 19 years after 0N/A * the time when the Date class is initialized. 0N/A * After adjusting the year number, 1900 is subtracted from 0N/A * it. For example, if the current year is 1999 then years in 0N/A * the range 19 to 99 are assumed to mean 1919 to 1999, while 0N/A * years from 0 to 18 are assumed to mean 2000 to 2018. Note 0N/A * that this is slightly different from the interpretation of 0N/A * years less than 100 that is used in {@link java.text.SimpleDateFormat}. 0N/A * <li>If the number is followed by a colon, it is regarded as an hour, 0N/A * unless an hour has already been recognized, in which case it is 0N/A * regarded as a minute. 0N/A * <li>If the number is followed by a slash, it is regarded as a month 0N/A * (it is decreased by 1 to produce a number in the range <tt>0</tt> 0N/A * to <tt>11</tt>), unless a month has already been recognized, in 0N/A * which case it is regarded as a day of the month. 0N/A * <li>If the number is followed by whitespace, a comma, a hyphen, or 0N/A * end of string, then if an hour has been recognized but not a 0N/A * minute, it is regarded as a minute; otherwise, if a minute has 0N/A * been recognized but not a second, it is regarded as a second; 0N/A * otherwise, it is regarded as a day of the month. </ul><p> 0N/A * A consecutive sequence of letters is regarded as a word and treated 0N/A * <li>A word that matches <tt>AM</tt>, ignoring case, is ignored (but 0N/A * the parse fails if an hour has not been recognized or is less 0N/A * than <tt>1</tt> or greater than <tt>12</tt>). 0N/A * <li>A word that matches <tt>PM</tt>, ignoring case, adds <tt>12</tt> 0N/A * to the hour (but the parse fails if an hour has not been 0N/A * recognized or is less than <tt>1</tt> or greater than <tt>12</tt>). 0N/A * <li>Any word that matches any prefix of <tt>SUNDAY, MONDAY, TUESDAY, 0N/A * WEDNESDAY, THURSDAY, FRIDAY</tt>, or <tt>SATURDAY</tt>, ignoring 0N/A * case, is ignored. For example, <tt>sat, Friday, TUE</tt>, and 0N/A * <tt>Thurs</tt> are ignored. 0N/A * <li>Otherwise, any word that matches any prefix of <tt>JANUARY, 0N/A * FEBRUARY, MARCH, APRIL, MAY, JUNE, JULY, AUGUST, SEPTEMBER, 0N/A * OCTOBER, NOVEMBER</tt>, or <tt>DECEMBER</tt>, ignoring case, and 0N/A * considering them in the order given here, is recognized as 0N/A * specifying a month and is converted to a number (<tt>0</tt> to 0N/A * <tt>11</tt>). For example, <tt>aug, Sept, april</tt>, and 0N/A * <tt>NOV</tt> are recognized as months. So is <tt>Ma</tt>, which 0N/A * is recognized as <tt>MARCH</tt>, not <tt>MAY</tt>. 0N/A * <li>Any word that matches <tt>GMT, UT</tt>, or <tt>UTC</tt>, ignoring 0N/A * case, is treated as referring to UTC. 0N/A * <li>Any word that matches <tt>EST, CST, MST</tt>, or <tt>PST</tt>, 0N/A * ignoring case, is recognized as referring to the time zone in 0N/A * North America that is five, six, seven, or eight hours west of 0N/A * Greenwich, respectively. Any word that matches <tt>EDT, CDT, 0N/A * MDT</tt>, or <tt>PDT</tt>, ignoring case, is recognized as 0N/A * referring to the same time zone, respectively, during daylight 0N/A * saving time.</ul><p> 0N/A * Once the entire string s has been scanned, it is converted to a time 0N/A * result in one of two ways. If a time zone or time-zone offset has been 0N/A * recognized, then the year, month, day of month, hour, minute, and 0N/A * second are interpreted in UTC and then the time-zone offset is 0N/A * applied. Otherwise, the year, month, day of month, hour, minute, and 0N/A * second are interpreted in the local time zone. 0N/A * @param s a string to be parsed as a date. 0N/A * @return the number of milliseconds since January 1, 1970, 00:00:00 GMT 0N/A * represented by the string argument. 0N/A * @see java.text.DateFormat 0N/A * @deprecated As of JDK version 1.1, 0N/A * replaced by <code>DateFormat.parse(String s)</code>. 0N/A if (c <=
' ' || c ==
',')
0N/A if (c ==
'(') {
// skip comments 0N/A if (
'0' <= c && c <=
'9') {
0N/A n = n *
10 + c -
'0';
0N/A n = n *
60;
// EG. "GMT-3" 0N/A n = n %
100 + n /
100 *
60;
// eg "GMT-0430" 0N/A if (
prevc ==
'+')
// plus means east of GMT 0N/A else if (c <=
' ' || c ==
',' || c ==
'/' || i >=
limit)
0N/A // year = n < 1900 ? n : n - 1900; 0N/A else if (i <
limit && c !=
',' && c >
' ' && c !=
'-')
0N/A // Handle two-digit years < 70 (70-99 handled above). 0N/A }
else if (c ==
'/' || c ==
':' || c ==
'+' || c ==
'-')
0N/A if (!(
'A' <= c && c <=
'Z' ||
'a' <= c && c <=
'z'))
0N/A // Parse 2-digit years within the correct default century. 0N/A if (
tzoffset == -
1) {
// no time zone specified, have to use local 0N/A "monday",
"tuesday",
"wednesday",
"thursday",
"friday",
0N/A "saturday",
"sunday",
0N/A "january",
"february",
"march",
"april",
"may",
"june",
0N/A "july",
"august",
"september",
"october",
"november",
"december",
0N/A "gmt",
"ut",
"utc",
"est",
"edt",
"cst",
"cdt",
0N/A "mst",
"mdt",
"pst",
"pdt" 0N/A private final static int ttb[] = {
0N/A 14,
1,
0,
0,
0,
0,
0,
0,
0,
0N/A 2,
3,
4,
5,
6,
7,
8,
9,
10,
11,
12,
13,
0N/A * Returns a value that is the result of subtracting 1900 from the 0N/A * year that contains or begins with the instant in time represented 0N/A * by this <code>Date</code> object, as interpreted in the local 0N/A * @return the year represented by this date, minus 1900. 0N/A * @see java.util.Calendar 0N/A * @deprecated As of JDK version 1.1, 0N/A * replaced by <code>Calendar.get(Calendar.YEAR) - 1900</code>. 0N/A * Sets the year of this <tt>Date</tt> object to be the specified 0N/A * value plus 1900. This <code>Date</code> object is modified so 0N/A * that it represents a point in time within the specified year, 0N/A * with the month, date, hour, minute, and second the same as 0N/A * before, as interpreted in the local time zone. (Of course, if 0N/A * the date was February 29, for example, and the year is set to a 0N/A * non-leap year, then the new date will be treated as if it were 0N/A * @param year the year value. 0N/A * @see java.util.Calendar 0N/A * @deprecated As of JDK version 1.1, 0N/A * replaced by <code>Calendar.set(Calendar.YEAR, year + 1900)</code>. 0N/A * Returns a number representing the month that contains or begins 0N/A * with the instant in time represented by this <tt>Date</tt> object. 0N/A * The value returned is between <code>0</code> and <code>11</code>, 0N/A * with the value <code>0</code> representing January. 0N/A * @return the month represented by this date. 0N/A * @see java.util.Calendar 0N/A * @deprecated As of JDK version 1.1, 0N/A * replaced by <code>Calendar.get(Calendar.MONTH)</code>. 0N/A * Sets the month of this date to the specified value. This 0N/A * <tt>Date</tt> object is modified so that it represents a point 0N/A * in time within the specified month, with the year, date, hour, 0N/A * minute, and second the same as before, as interpreted in the 0N/A * local time zone. If the date was October 31, for example, and 0N/A * the month is set to June, then the new date will be treated as 0N/A * if it were on July 1, because June has only 30 days. 0N/A * @param month the month value between 0-11. 0N/A * @see java.util.Calendar 0N/A * @deprecated As of JDK version 1.1, 0N/A * replaced by <code>Calendar.set(Calendar.MONTH, int month)</code>. 0N/A * Returns the day of the month represented by this <tt>Date</tt> object. 0N/A * The value returned is between <code>1</code> and <code>31</code> 0N/A * representing the day of the month that contains or begins with the 0N/A * instant in time represented by this <tt>Date</tt> object, as 0N/A * interpreted in the local time zone. 0N/A * @return the day of the month represented by this date. 0N/A * @see java.util.Calendar 0N/A * @deprecated As of JDK version 1.1, 0N/A * replaced by <code>Calendar.get(Calendar.DAY_OF_MONTH)</code>. 0N/A * Sets the day of the month of this <tt>Date</tt> object to the 0N/A * specified value. This <tt>Date</tt> object is modified so that 0N/A * it represents a point in time within the specified day of the 0N/A * month, with the year, month, hour, minute, and second the same 0N/A * as before, as interpreted in the local time zone. If the date 0N/A * was April 30, for example, and the date is set to 31, then it 0N/A * will be treated as if it were on May 1, because April has only 0N/A * @param date the day of the month value between 1-31. 0N/A * @see java.util.Calendar 0N/A * @deprecated As of JDK version 1.1, 0N/A * replaced by <code>Calendar.set(Calendar.DAY_OF_MONTH, int date)</code>. 0N/A * Returns the day of the week represented by this date. The 0N/A * returned value (<tt>0</tt> = Sunday, <tt>1</tt> = Monday, 0N/A * <tt>2</tt> = Tuesday, <tt>3</tt> = Wednesday, <tt>4</tt> = 0N/A * Thursday, <tt>5</tt> = Friday, <tt>6</tt> = Saturday) 0N/A * represents the day of the week that contains or begins with 0N/A * the instant in time represented by this <tt>Date</tt> object, 0N/A * as interpreted in the local time zone. 0N/A * @return the day of the week represented by this date. 0N/A * @see java.util.Calendar 0N/A * @deprecated As of JDK version 1.1, 0N/A * replaced by <code>Calendar.get(Calendar.DAY_OF_WEEK)</code>. 0N/A * Returns the hour represented by this <tt>Date</tt> object. The 0N/A * returned value is a number (<tt>0</tt> through <tt>23</tt>) 0N/A * representing the hour within the day that contains or begins 0N/A * with the instant in time represented by this <tt>Date</tt> 0N/A * object, as interpreted in the local time zone. 0N/A * @return the hour represented by this date. 0N/A * @see java.util.Calendar 0N/A * @deprecated As of JDK version 1.1, 0N/A * replaced by <code>Calendar.get(Calendar.HOUR_OF_DAY)</code>. 0N/A * Sets the hour of this <tt>Date</tt> object to the specified value. 0N/A * This <tt>Date</tt> object is modified so that it represents a point 0N/A * in time within the specified hour of the day, with the year, month, 0N/A * date, minute, and second the same as before, as interpreted in the 0N/A * @param hours the hour value. 0N/A * @see java.util.Calendar 0N/A * @deprecated As of JDK version 1.1, 0N/A * replaced by <code>Calendar.set(Calendar.HOUR_OF_DAY, int hours)</code>. 0N/A * Returns the number of minutes past the hour represented by this date, 0N/A * as interpreted in the local time zone. 0N/A * The value returned is between <code>0</code> and <code>59</code>. 0N/A * @return the number of minutes past the hour represented by this date. 0N/A * @see java.util.Calendar 0N/A * @deprecated As of JDK version 1.1, 0N/A * replaced by <code>Calendar.get(Calendar.MINUTE)</code>. 0N/A * Sets the minutes of this <tt>Date</tt> object to the specified value. 0N/A * This <tt>Date</tt> object is modified so that it represents a point 0N/A * in time within the specified minute of the hour, with the year, month, 0N/A * date, hour, and second the same as before, as interpreted in the 0N/A * @param minutes the value of the minutes. 0N/A * @see java.util.Calendar 0N/A * @deprecated As of JDK version 1.1, 0N/A * replaced by <code>Calendar.set(Calendar.MINUTE, int minutes)</code>. 0N/A * Returns the number of seconds past the minute represented by this date. 0N/A * The value returned is between <code>0</code> and <code>61</code>. The 0N/A * values <code>60</code> and <code>61</code> can only occur on those 0N/A * Java Virtual Machines that take leap seconds into account. 0N/A * @return the number of seconds past the minute represented by this date. 0N/A * @see java.util.Calendar 0N/A * @deprecated As of JDK version 1.1, 0N/A * replaced by <code>Calendar.get(Calendar.SECOND)</code>. 0N/A * Sets the seconds of this <tt>Date</tt> to the specified value. 0N/A * This <tt>Date</tt> object is modified so that it represents a 0N/A * point in time within the specified second of the minute, with 0N/A * the year, month, date, hour, and minute the same as before, as 0N/A * interpreted in the local time zone. 0N/A * @param seconds the seconds value. 0N/A * @see java.util.Calendar 0N/A * @deprecated As of JDK version 1.1, 0N/A * replaced by <code>Calendar.set(Calendar.SECOND, int seconds)</code>. 0N/A * Returns the number of milliseconds since January 1, 1970, 00:00:00 GMT 0N/A * represented by this <tt>Date</tt> object. 0N/A * @return the number of milliseconds since January 1, 1970, 00:00:00 GMT 0N/A * represented by this date. 0N/A * Sets this <code>Date</code> object to represent a point in time that is 0N/A * <code>time</code> milliseconds after January 1, 1970 00:00:00 GMT. 0N/A * @param time the number of milliseconds. 0N/A * Tests if this date is before the specified date. 0N/A * @param when a date. 0N/A * @return <code>true</code> if and only if the instant of time 0N/A * represented by this <tt>Date</tt> object is strictly 0N/A * earlier than the instant represented by <tt>when</tt>; 0N/A * <code>false</code> otherwise. 0N/A * @exception NullPointerException if <code>when</code> is null. 0N/A * Tests if this date is after the specified date. 0N/A * @param when a date. 0N/A * @return <code>true</code> if and only if the instant represented 0N/A * by this <tt>Date</tt> object is strictly later than the 0N/A * instant represented by <tt>when</tt>; 0N/A * <code>false</code> otherwise. 0N/A * @exception NullPointerException if <code>when</code> is null. 0N/A * Compares two dates for equality. 0N/A * The result is <code>true</code> if and only if the argument is 0N/A * not <code>null</code> and is a <code>Date</code> object that 0N/A * represents the same point in time, to the millisecond, as this object. 0N/A * Thus, two <code>Date</code> objects are equal if and only if the 0N/A * <code>getTime</code> method returns the same <code>long</code> 0N/A * @param obj the object to compare with. 0N/A * @return <code>true</code> if the objects are the same; 0N/A * <code>false</code> otherwise. 0N/A * @see java.util.Date#getTime() 0N/A * Returns the millisecond value of this <code>Date</code> object 0N/A * without affecting its internal state. 0N/A * Compares two Dates for ordering. 0N/A * @param anotherDate the <code>Date</code> to be compared. 0N/A * @return the value <code>0</code> if the argument Date is equal to 0N/A * this Date; a value less than <code>0</code> if this Date 0N/A * is before the Date argument; and a value greater than 0N/A * <code>0</code> if this Date is after the Date argument. 0N/A * @exception NullPointerException if <code>anotherDate</code> is null. 0N/A * Returns a hash code value for this object. The result is the 0N/A * exclusive OR of the two halves of the primitive <tt>long</tt> 0N/A * value returned by the {@link Date#getTime} 0N/A * method. That is, the hash code is the value of the expression: 0N/A * (int)(this.getTime()^(this.getTime() >>> 32))</pre></blockquote> 0N/A * @return a hash code value for this object. 0N/A return (
int)
ht ^ (
int) (
ht >>
32);
0N/A * Converts this <code>Date</code> object to a <code>String</code> 0N/A * dow mon dd hh:mm:ss zzz yyyy</pre></blockquote> 0N/A * <li><tt>dow</tt> is the day of the week (<tt>Sun, Mon, Tue, Wed, 0N/A * Thu, Fri, Sat</tt>). 0N/A * <li><tt>mon</tt> is the month (<tt>Jan, Feb, Mar, Apr, May, Jun, 0N/A * Jul, Aug, Sep, Oct, Nov, Dec</tt>). 0N/A * <li><tt>dd</tt> is the day of the month (<tt>01</tt> through 0N/A * <tt>31</tt>), as two decimal digits. 0N/A * <li><tt>hh</tt> is the hour of the day (<tt>00</tt> through 0N/A * <tt>23</tt>), as two decimal digits. 0N/A * <li><tt>mm</tt> is the minute within the hour (<tt>00</tt> through 0N/A * <tt>59</tt>), as two decimal digits. 0N/A * <li><tt>ss</tt> is the second within the minute (<tt>00</tt> through 0N/A * <tt>61</tt>, as two decimal digits. 0N/A * <li><tt>zzz</tt> is the time zone (and may reflect daylight saving 0N/A * time). Standard time zone abbreviations include those 0N/A * recognized by the method <tt>parse</tt>. If time zone 0N/A * information is not available, then <tt>zzz</tt> is empty - 0N/A * that is, it consists of no characters at all. 0N/A * <li><tt>yyyy</tt> is the year, as four decimal digits. 0N/A * @return a string representation of this date. 0N/A * @see java.util.Date#toLocaleString() 0N/A * @see java.util.Date#toGMTString() 0N/A // "EEE MMM dd HH:mm:ss zzz yyyy"; 0N/A * Converts the given name to its 3-letter abbreviation (e.g., 0N/A * "monday" -> "Mon") and stored the abbreviation in the given 0N/A * <code>StringBuilder</code>. 0N/A * Creates a string representation of this <tt>Date</tt> object in an 0N/A * implementation-dependent form. The intent is that the form should 0N/A * be familiar to the user of the Java application, wherever it may 0N/A * happen to be running. The intent is comparable to that of the 0N/A * "<code>%c</code>" format supported by the <code>strftime()</code> 0N/A * function of ISO C. 0N/A * @return a string representation of this date, using the locale 0N/A * @see java.text.DateFormat 0N/A * @see java.util.Date#toString() 0N/A * @see java.util.Date#toGMTString() 0N/A * @deprecated As of JDK version 1.1, 0N/A * replaced by <code>DateFormat.format(Date date)</code>. 0N/A * Creates a string representation of this <tt>Date</tt> object of 0N/A * d mon yyyy hh:mm:ss GMT</pre></blockquote> 0N/A * <li><i>d</i> is the day of the month (<tt>1</tt> through <tt>31</tt>), 0N/A * as one or two decimal digits. 0N/A * <li><i>mon</i> is the month (<tt>Jan, Feb, Mar, Apr, May, Jun, Jul, 0N/A * Aug, Sep, Oct, Nov, Dec</tt>). 0N/A * <li><i>yyyy</i> is the year, as four decimal digits. 0N/A * <li><i>hh</i> is the hour of the day (<tt>00</tt> through <tt>23</tt>), 0N/A * as two decimal digits. 0N/A * <li><i>mm</i> is the minute within the hour (<tt>00</tt> through 0N/A * <tt>59</tt>), as two decimal digits. 0N/A * <li><i>ss</i> is the second within the minute (<tt>00</tt> through 0N/A * <tt>61</tt>), as two decimal digits. 0N/A * <li><i>GMT</i> is exactly the ASCII letters "<tt>GMT</tt>" to indicate 0N/A * Greenwich Mean Time. 0N/A * The result does not depend on the local time zone. 0N/A * @return a string representation of this date, using the Internet GMT 0N/A * @see java.text.DateFormat 0N/A * @see java.util.Date#toString() 0N/A * @see java.util.Date#toLocaleString() 0N/A * @deprecated As of JDK version 1.1, 0N/A * replaced by <code>DateFormat.format(Date date)</code>, using a 0N/A * GMT <code>TimeZone</code>. 0N/A // d MMM yyyy HH:mm:ss 'GMT' 0N/A * Returns the offset, measured in minutes, for the local time zone 0N/A * relative to UTC that is appropriate for the time represented by 0N/A * this <code>Date</code> object. 0N/A * For example, in Massachusetts, five time zones west of Greenwich: 0N/A * new Date(96, 1, 14).getTimezoneOffset() returns 300</pre></blockquote> 0N/A * because on February 14, 1996, standard time (Eastern Standard Time) 0N/A * is in use, which is offset five hours from UTC; but: 0N/A * new Date(96, 5, 1).getTimezoneOffset() returns 240</pre></blockquote> 0N/A * because on June 1, 1996, daylight saving time (Eastern Daylight Time) 0N/A * is in use, which is offset only four hours from UTC.<p> 0N/A * This method produces the same result as if it computed: 0N/A * (this.getTime() - UTC(this.getYear(), 0N/A * this.getMinutes(), 0N/A * this.getSeconds())) / (60 * 1000) 0N/A * </pre></blockquote> 0N/A * @return the time-zone offset, in minutes, for the current time zone. 0N/A * @see java.util.Calendar#ZONE_OFFSET 0N/A * @see java.util.Calendar#DST_OFFSET 0N/A * @see java.util.TimeZone#getDefault 0N/A * @deprecated As of JDK version 1.1, 0N/A * replaced by <code>-(Calendar.get(Calendar.ZONE_OFFSET) + 0N/A * Calendar.get(Calendar.DST_OFFSET)) / (60 * 1000)</code>. 0N/A // Normalize cdate with the TimeZone in cdate first. This is 0N/A // required for the compatible behavior. 0N/A // If the default TimeZone has changed, then recalculate the 0N/A // fields with the new TimeZone. 0N/A // fastTime and the returned data are in sync upon return. 0N/A // If the specified year can't be handled using a long value 0N/A // in milliseconds, GregorianCalendar is used for full 0N/A // compatibility with underflow and overflow. This is required 0N/A // by some JCK tests. The limits are based max year values - 0N/A // years that can be represented by max values of d, hh, mm, 0N/A // ss and ms. Also, let GregorianCalendar handle the default 0N/A // cutover year so that we don't need to worry about the 0N/A if (y ==
1582 || y >
280000000 || y < -
280000000) {
0N/A // Perform the GregorianCalendar-style normalization. 0N/A // In case the normalized date requires the other calendar 0N/A // system, we need to recalculate it using the other one. 0N/A * Returns the Gregorian or Julian calendar system to use with the 0N/A * given date. Use Gregorian from October 15, 1582. 0N/A * @param year normalized calendar year (not -1900) 0N/A * @return the CalendarSystem to use for the specified date 0N/A // Quickly check if the time stamp given by `utc' is the Epoch 0N/A // or later. If it's before 1970, we convert the cutover to 0N/A // local time to compare. 0N/A * Save the state of this object to a stream (i.e., serialize it). 0N/A * @serialData The value returned by <code>getTime()</code> 0N/A * is emitted (long). This represents the offset from 0N/A * January 1, 1970, 00:00:00 GMT in milliseconds. 0N/A * Reconstitute this object from a stream (i.e., deserialize it).