However, there are some formats that are supported in all major implementations - like RFC 2822 format - in which case their usage can be acceptable. Note: You are encouraged to make sure your input conforms to the date time string format above for maximum compatibility, because support for other formats is not guaranteed. The toISOString() method returns a string representation of the date in the date time string format, with the time zone offset always set to Z (UTC). Furthermore, implementations are allowed to support other date formats when the input fails to match this format. See Broken Parser – A Web Reality Issue.ĭate.parse() and the Date() constructor both accept strings in the date time string format as input. This is due to a historical spec error that was not consistent with ISO 8601 but could not be changed due to web compatibility. When the time zone offset is absent, date-only forms are interpreted as a UTC time and date-time forms are interpreted as local time. Each combination can be followed by a time zone offset.įor example, "" ( date-only form), "T14:48:00" ( date-time form), or "T14:48:00.000+09:00" ( date-time form with milliseconds and time zone) are all valid date time strings.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |