Returns a Date object given a string formatted according to a subset of the ISO-8601 standard.
Accepts a string formatted according to a profile of ISO8601 as defined by RFC3339, except that partial input is allowed. Can also process dates as specified by the W3C The following combinations are valid:
timezones may be specified as Z (for UTC) or +/- followed by a time expression HH:mm Assumes the local time zone if not specified. Does not validate. Improperly formatted input may return null. Arguments which are out of bounds will be handled by the Date constructor (e.g. January 32nd typically gets resolved to February 1st) Only years between 100 and 9999 are supported.
Parameter | Type | Description |
---|---|---|
formattedString | String | A string such as 2005-06-30T08:05:00-07:00 or 2005-06-30 or T08:05:00 |
defaultTime | Number |
Optional Used for defaults for fields omitted in the formattedString. Uses 1970-01-01T00:00:00.0Z by default. |
Format a Date object as a string according a subset of the ISO-8601 standard
When options.selector is omitted, output follows RFC3339 The local time zone is included as an offset from GMT, except when selector=='time' (time without a date) Does not check bounds. Only years between 100 and 9999 are supported.
Parameter | Type | Description |
---|---|---|
dateObject | Date | A Date object |
options | Object |
Optional An object with the following properties:
|