Format a date into a string value with a specified format.
The format can be combinations of the following:
- d - day of month (no leading zero)
- dd - day of month (two digit)
- D - day name short
- DD - day name long
- m - month of year (no leading zero)
- mm - month of year (two digit)
- M - month name short
- MM - month name long
- y - year (two digit)
- yy - year (four digit)
- @ - Unix timestamp (also known as epoch seconds or POSIX time) in milliseconds since 01/01/1970
- '...' - literal text
- '' - single quote
- anything else - literal text
There are also a number of predefined standard date formats available from $.datepicker:
- ATOM - 'yy-mm-dd' (Same as RFC 3339/ISO 8601)
- COOKIE - 'D, dd M yy'
- ISO_8601 - 'yy-mm-dd'
- RFC_822 - 'D, d M y' (See RFC 822)
- RFC_850 - 'DD, dd-M-y' (See RFC 850)
- RFC_1036 - 'D, d M y' (See RFC 1036)
- RFC_1123 - 'D, d M yy' (See RFC 1123)
- RFC_2822 - 'D, d M yy' (See RFC 2822)
- RSS - 'D, d M y' (Same as RFC 822)
- TIMESTAMP - '@'
- W3C - 'yy-mm-dd' (Same as ISO 8601)
Arguments:
| format | String | |
|---|---|---|
| The format to use in presenting the date. | ||
| date | Date | |
| The date value to be displayed. | ||
| settings (Optional) | Object | |
| Additional parameters for formatting the date. All are optional and default to the datapicker defaults, which are usually standard English. Attributes include: | ||
