Date.Date

Date.Date

Class Overview | Class Members | This Package | All Packages

Syntax 1
public Date()
Description
Allocates a Date object and initializes it so that it represents the time at which it was allocated measured to the nearest millisecond.

See Also
currentTimeMillis



Syntax 2
public Date( long date )
Parameters
date
the milliseconds since January 1, 1970, 00:00:00 GMT.
Description
Allocates a Date object and initializes it to represent the specified number of milliseconds since January 1, 1970, 00:00:00 GMT.

See Also
currentTimeMillis



Syntax 3
public Date( int year, int month, int date )
Parameters
year
the year minus 1900.
month
the month between 0-11.
date
the day of the month between 1-31.
Description
Note: Date() is deprecated.

Allocates a Date object and initializes it so that it represents midnight, local time, at the beginning of the day specified by the year, month, and date arguments.

See Also
Calendar



Syntax 4
public Date( int year, int month, int date, int hrs, int min )
Parameters
year
the year minus 1900.
month
the month between 0-11.
date
the day of the month between 1-31.
hrs
the hours between 0-23.
min
the minutes between 0-59.
Description
Note: Date() is deprecated.

Allocates a Date object and initializes it so that it represents the specified hour and minute, local time, of the date specified by the year, month, date, hrs, and min arguments.

See Also
Calendar



Syntax 5
public Date( int year, int month, int date, int hrs, int min, int sec )
Parameters
year
the year minus 1900.
month
the month between 0-11.
date
the day of the month between 1-31.
hrs
the hours between 0-23.
min
the minutes between 0-59.
sec
the seconds between 0-59.
Description
Note: Date() is deprecated.

Allocates a Date object and initializes it so that it represents the specified hour, minute, and second, local time of the date specified by the year, month, date, hrs, min, and sec arguments.

See Also
Calendar



Syntax 6
public Date( String s )
Parameters
s
a string representation of the date.
Description
Note: Date() is deprecated.

Allocates a Date object and initializes it so that it represents the date and time indicated by the string s, which is interpreted as if by the parse method.

See Also
DateFormat, parse