DateTime
Contents
[
Hide
]DateTime class
Represents an instant in time, typically expressed as a date and time of day.
DateTime(year, month, day)
Initializes a new instance of the DateTime object to the specified year, month, and day.
Methods
| Name | Description |
|---|---|
| toDate | Converts the value of the current DateTime object to Date object. |
| toCalendar | Converts the value of the current DateTime object to Calendar object. |
| addDays | Adds the specified number of days to the value of this instance. |
| addHours | Adds the specified number of hours to the value of this instance. |
| addMilliseconds | Adds the specified number of milliseconds to the value of this instance. |
| addMinutes | Adds the specified number of minutes to the value of this instance. |
| addMonths | Adds the specified number of months to the value of this instance. |
| addSeconds | Adds the specified number of seconds to the value of this instance. |
| addYears | Adds the specified number of years to the value of this instance. |
| compareTo | Compares the value of this instance to a specified object that contains a specified DateTime value, and returns an integ |
| hashCode | Returns the hash code for this instance. |
| equals | Returns a value indicating whether this instance is equal to a specified object. |
| getDay | Gets the day of the month represented by this instance. |
| getDayOfWeek | Gets the day of the week represented by this instance. |
| getDayOfYear | Gets the day of the year represented by this instance. |
| getHour | Gets the hour component of the date represented by this instance. |
| getMillisecond | Gets the milliseconds component of the date represented by this instance. |
| getMinute | Gets the minute component of the date represented by this instance. |
| getMonth | Gets the month component of the date represented by this instance. |
| getNow | Gets a DateTime object that is set to the current date and time on this computer, expressed as the local time. |
| getSecond | Gets the seconds component of the date represented by this instance. |
| getYear | Gets the year component of the date represented by this instance. |
| toString | Converts the value of the current DateTime object to its equivalent string representation. |