Functiondojo.date.stamp.fromISOString

dojo.require("dojo.date.stamp");
defined in dojo/date/stamp.js

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:

  • dates only
    • yyyy
    • yyyy-MM
    • yyyy-MM-dd
  • times only, with an optional time zone appended
    • THH:mm
    • THH:mm:ss
    • THH:mm:ss.SSS
  • and "datetimes" which could be any combination of the above

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.

Usage

function (/*String*/ formattedString, /*Number?*/ defaultTime) (view source)
parametertypedescription
formattedStringStringA string such as 2005-06-30T08:05:00-07:00 or 2005-06-30 or T08:05:00
defaultTimeNumberOptional. Used for defaults for fields omitted in the formattedString. Uses 1970-01-01T00:00:00.0Z by default.