Constructor Summary |
---|
DateTime(year, month, day)
Initializes a new instance of the DateTime object to the specified year, month, and day. |
DateTime(year, month, day, hour, minute, second)
Initializes a new instance of the DateTime object to the specified year, month, day, hour, minute, and second. |
DateTime(year, month, day, hour, minute, second, millisecond)
Initializes a new instance of the DateTime object to the specified year, month, day, hour, minute, second, and millisecond. |
DateTime(date)
Initializes a new instance of the DateTime object to the specified Date object |
DateTime(cld)
Initializes a new instance of the DateTime object to the specified Calendar object |
Method Summary | ||
---|---|---|
method | addDays(value) | |
Adds the specified number of days to the value of this instance.
|
||
method | addHours(value) | |
Adds the specified number of hours to the value of this instance.
|
||
method | addMilliseconds(value) | |
Adds the specified number of milliseconds to the value of this instance.
|
||
method | addMinutes(value) | |
Adds the specified number of minutes to the value of this instance.
|
||
method | addMonths(months) | |
Adds the specified number of months to the value of this instance.
|
||
method | addSeconds(value) | |
Adds the specified number of seconds to the value of this instance.
|
||
method | addYears(value) | |
Adds the specified number of years to the value of this instance.
|
||
method | compareTo(value) | |
Compares the value of this instance to a specified DateTime value
and returns an integer that indicates whether this instance is earlier than,
the same as, or later than the specified DateTime value.
|
||
method | compareTo(value) | |
Compares the value of this instance to a specified object that contains a
specified DateTime value, and returns an integer that indicates whether
this instance is earlier than, the same as, or later than the specified DateTime value.
|
||
method | equals(value) | |
Returns a value indicating whether this instance is equal to a specified object.
|
||
method | getDay() | |
Gets the day of the month represented by this instance.
|
||
method | getDayOfWeek() | |
Gets the day of the week represented by this instance.
|
||
method | getDayOfYear() | |
Gets the day of the year represented by this instance.
|
||
method | getHour() | |
Gets the hour component of the date represented by this instance.
|
||
method | getMillisecond() | |
Gets the milliseconds component of the date represented by this instance.
|
||
method | getMinute() | |
Gets the minute component of the date represented by this instance.
|
||
method | getMonth() | |
Gets the month component of the date represented by this instance.
|
||
static method | getNow() | |
Gets a DateTime object that is set to the current date and time on this computer, expressed as the local time.
|
||
method | getSecond() | |
Gets the seconds component of the date represented by this instance.
|
||
method | getYear() | |
Gets the year component of the date represented by this instance.
|
||
method | hashCode() | |
Returns the hash code for this instance.
|
||
method | toCalendar() | |
Converts the value of the current DateTime object to Calendar object.
|
||
method | toDate() | |
Converts the value of the current DateTime object to Date object.
|
||
method | toString() | |
Converts the value of the current DateTime object to its equivalent string representation.
|
DateTime(year, month, day)
year: int
- The year (1 through 9999).month: int
- The month (1 through 12).day: int
- The day (1 through the number of days in month).DateTime(year, month, day, hour, minute, second)
year: int
- The year (1 through 9999).month: int
- The month (1 through 12).day: int
- The day (1 through the number of days in month).hour: int
- The hours (0 through 23).minute: int
- The minutes (0 through 59).second: int
- The seconds (0 through 59).DateTime(year, month, day, hour, minute, second, millisecond)
year: int
- The year (1 through 9999).month: int
- The month (1 through 12).day: int
- The day (1 through the number of days in month).hour: int
- The hours (0 through 23).minute: int
- The minutes (0 through 59).second: int
- The seconds (0 through 59).millisecond: int
- The milliseconds (0 through 999).DateTime(date)
date: Date
- The Date objectDateTime(cld)
cld: Calendar
- The Calendar objectDate toDate()
Calendar toCalendar()
DateTime addDays(value)
value: float
- A number of whole and fractional days. The value parameter can be negative or positive.DateTime addHours(value)
value: float
- A number of whole and fractional hours. The value parameter can be negative or positive.DateTime addMilliseconds(value)
value: float
- A number of whole and fractional milliseconds. The value parameter can be negative or positive. Note that this value is rounded to the nearest integer.DateTime addMinutes(value)
value: float
- A number of whole and fractional minutes. The value parameter can be negative or positive.DateTime addMonths(months)
months: int
- A number of months. The months parameter can be negative or positive.DateTime addSeconds(value)
value: float
- A number of whole and fractional seconds. The value parameter can be negative or positive.DateTime addYears(value)
value: int
- A number of years. The value parameter can be negative or positive.int compareTo(value)
value: Object
- A boxed DateTime object to compare, or null.int compareTo(value)
value: DateTime
- A DateTime object to compare.int hashCode()
boolean equals(value)
value: Object
- An object to compare to this instance.int getDay()
int getDayOfWeek()
int getDayOfYear()
int getHour()
int getMillisecond()
int getMinute()
int getMonth()
static DateTime getNow()
int getSecond()
int getYear()
String toString()