21.3
java.util.Date
THE PACKAGE JAVA.UTIL
A date (day of month) is represented by an integer from 1 to 31 in the usual
manner.
An hour is represented by an integer from 0 to 23. Thus the hour from mid
night to 1
AM
is hour 0, and the hour from noon to 1
PM
is hour 12.
A minute is represented by an integer from 0 to 59 in the usual manner.
A second is represented by an integer from 0 to 61. The values 60 and 61 will
occur only for leap seconds, and even then only in Java implementations that
actually track leap seconds correctly. Because of the manner in which leap
seconds are currently introduced, it is extremely unlikely that two leap sec
onds will occur in the same minute, but this specification follows the date and
time conventions for ISO C.
In all cases, arguments given to methods for these purposes need not fall within
the indicated ranges; for example, a date may be specified as January 32 and will
be interpreted as meaning February 1.
21.3.1
public Date()
This constructor initializes a newly created
Date
object so that it represents the
instant of time that it was created, measured to the nearest millisecond.
21.3.2
public Date(long time)
This constructor initializes a newly created
Date
object so that it represents the
instant of time that is
time
milliseconds after the standard base time known as
the epoch, namely 00:00:00 GMT on January 1, 1970. See also the method
currentTimeMillis
( 20.18.6) of class
System
.
21.3.3
public Date(int year, int month, int date)
This constructor initializes a newly created
Date
object so that it represents mid
night at the beginning of the day specified by the
year
,
month
, and
date
argu
ments, in the local time zone. Thus, it has the same effect as the constructor call
( 21.3.5):
Date(year, month, date, 0, 0, 0)
624
footer
Our partners:
PHP: Hypertext Preprocessor Best Web Hosting
Java Web Hosting
Inexpensive Web Hosting
Jsp Web Hosting
Cheapest Web Hosting
Jsp Hosting
Cheap Hosting
Visionwebhosting.net Business web hosting division of Web
Design Plus. All rights reserved