/* java.util.Date Copyright (C) 1998, 1999, 2000, 2001, 2005 Free Software Foundation, Inc. This file is part of GNU Classpath. GNU Classpath is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with GNU Classpath; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package java.util; /** *
* This class represents a specific time in milliseconds since the epoch. * The epoch is 1970, January 1 00:00:00.0000 UTC. *
*
* Date is intended to reflect universal time coordinate (UTC),
* but this depends on the underlying host environment. Most operating systems
* don't handle the leap second, which occurs about once every year or
* so. The leap second is added to the last minute of the day on either
* the 30th of June or the 31st of December, creating a minute 61 seconds
* in length.
*
* The representations of the date fields are as follows: *
* Prior to JDK 1.1, this class was the sole class handling date and time
* related functionality. However, this particular solution was not
* amenable to internationalization. The new Calendar
* class should now be used to handle dates and times, with Date
* being used only for values in milliseconds since the epoch. The
* Calendar class, and its concrete implementations, handle
* the interpretation of these values into minutes, hours, days, months
* and years. The formatting and parsing of dates is left to the
* DateFormat class, which is able to handle the different
* types of date format which occur in different locales.
*
Date as the
* XOR of the most significant and the least significant
* 32 bits of the 64 bit milliseconds value.
*
* @return the hash code.
*/
public int hashCode()
{
return (int) time ^ (int) (time >>> 32);
}
/**
* * Returns a string representation of this date using * the following date format: *
*
* day mon dd hh:mm:ss zz yyyy
*
where the fields used here are: *
day -- the day of the week
* (Sunday through to Saturday).
* mon -- the month (Jan to Dec).
* dd -- the day of the month
* as two decimal digits (01 to 31).
* hh -- the hour of the day
* as two decimal digits in 24-hour clock notation
* (01 to 23).
* mm -- the minute of the day
* as two decimal digits (01 to 59).
* ss -- the second of the day
* as two decimal digits (01 to 61).
* zz -- the time zone information if available.
* The possible time zones used include the abbreviations
* recognised by parse() (e.g. GMT, CET, etc.)
* and may reflect the fact that daylight savings time is in
* effect. The empty string is used if there is no time zone
* information.
* yyyy -- the year as four decimal digits.
*
* The DateFormat class should now be
* preferred over using this method.
*