The methods defined in the Date primitive type are summarized in the following table.
Method | Description |
---|---|
day | Returns the day of the month as an integer |
dayName | Returns the name of the day of the week as a string |
dayNameWithLcid | Returns the name of the day of the week as a string for the specified locale |
dayOfWeek | Returns an integer value for the day of the week |
dayOfYear | Returns an integer value for the day of the year |
display | Returns the date as a string |
format | Returns the date as a string in the specified format |
isFormatable | Returns true if the date falls within the valid conversion range for the execution platform |
isLeapYear | Returns true if the year is a leap year |
isValid | Returns true if the date is valid |
longFormat | Returns the date as a string in the long date format |
month | Returns the month as an integer |
monthName | Returns the name of the month |
monthNameWithLcid | Returns the name of the month for the specified locale |
parseForCurrentLocale | Sets the receiver to the result of parsing a string representing a date for the current locale |
parseLongWithCurrentLocale | Sets the receiver to the result of parsing a string representing a date in the long date format for the current locale |
parseLongWithFmtAndLcid | Sets the receiver to the result of parsing a string representing a date for the specified long date format and the specified locale |
parseLongWithPicAndLcid | Sets the receiver to the result of parsing a string representing a date for the specified long date picture and the specified locale |
parseShortWithCurrentLocale | Sets the receiver to the result of parsing a string representing a date in the short date format for the current locale |
parseShortWithFmtAndLcid | Sets the receiver to the result of parsing a string representing a date for the specified short date format and the specified locale |
parseShortWithPicAndLcid | Sets the receiver to the result of parsing a string representing a date for the specified short date picture and the specified locale |
setByteOrderLocal | Returns a date that has the bytes ordered as required by the local node |
setByteOrderRemote | Returns a date that has the bytes ordered as required by the specified remote node |
setDate | Sets the receiver to a specified date |
setDateYearAbsolute | Sets the receiver to a specific absolute date |
shortDayNameWithLcid | Returns the short name of the week day for the specified locale |
shortFormat | Returns the date in the short date format |
shortMonthNameWithLcid | Returns the short name of the month for the specified locale |
subtract | Returns the interval between the receiver and the specified date |
userFormat | Returns the date as a string in the specified date format |
userLongFormatAndLcid | Returns the date as a string in the specified long date format for the specified locale |
userLongFormatPicAndLcid | Returns the date as a string formatted in the specified long date picture for the specified locale |
userShortFormatAndLcid | Returns the date as a string in the specified short date format for the specified locale |
userShortFormatPicAndLcid | Returns the date as a string formatted in the specified short date picture for the specified locale |
year | Returns the year as in integer |