Method |
Return Value |
Description |
add(time : TimeSpan) |
DateTime |
Adds the specified time to the date and returns the result |
addDays(days : int) |
DateTime |
Adds the specified number of days to the date and returns the
result |
addHours(hours : int) |
DateTime |
Adds the specified number of hours to the date and returns the
result |
addMilliseconds(millis : int) |
DateTime |
Adds the specified number of milliseconds to the date and
returns the result |
addMinutes(minutes: int) |
DateTime |
Adds the specified number of minutes to the date and returns
the result |
addMonths(months : int) |
DateTime |
Adds the specified number of months to the date and returns
the result |
addSeconds(seconds : int) |
DateTime |
Adds the specified number of seconds to the date and returns
the result |
addYears(years : int) |
DateTime |
Adds the specified number of years to the date and returns the
result |
compareTo(d : DateTime) |
int |
Returns -1, 0 or 1, depending on the compare result |
date() |
DateTime |
Returns just the date, with no time |
day() |
int |
Returns the day of the date |
dayOfWeek() |
int |
Returns the day of week. 1 = Monday to 7 = Sunday |
dayOfYear() |
int |
Returns the day of year |
equals(d : DateTime) |
bool |
Returns a value indicating if d is the same date |
format(format : string) |
string |
Returns a formatted date. Format is very similar to .NET's
date time custom formatting:
- d - Day of month, 1 to 31
- dd -
Day of Month, 01 to 31
- ddd -
Day of Week, Mon to Sun
- dddd -
Day of Week, Monday to Sunday
- f -
Millisecond / 100
- ff -
Millisecond / 10
- fff -
Millisecond
- h -
Hour of day, 1 to 12
- hh -
Hour of day, 01 to 12
- H -
Hour of day, 1 to 23
- HH -
Hour of day, 01 to 24
- m -
Minute, 1 to 59
- mm -
Minute, 01 to 59
- M -
Month, 1 to 12
- MM -
Month, 01 to 12
- MMM -
Month, Jan to Dec
- MMMM -
Month, January to December
- s -
Second, 1 to 59
- ss -
Second 01 to 59
- t - A
or P
- tt - AM
or PM
- yy -
Year, 10
- yyyy -
Year, 2010
- : -
TimeSeparator
- / -
DateSeparator
|
hour() |
int |
Gets the hour of the date |
millisecond() |
int |
Gets the millisecond of the date |
minute() |
int |
Gets the minute of the date |
month() |
int |
Gets the month of the date |
second() |
int |
Gets the second of the date |
subtractDate(d : DateTime) |
TimeSpan |
Subtracts the specified DateTime and
returns the resultTimeSpan |
subtractTime(t : TimeSpan) |
DateTime |
Subtracts the specified TimeSpan and
returns the resultDateTime |
timeOfDay() |
TimeSpan |
Gets just the time part of the date |
year() |
int |
Gets the year of the date |