ISO 8601 is a widely and internationally accepted standard for the language independent representation of time and date related data, generally in the Gregorian calendar.
Two main features of ISO 8601 include:
Easily readable by humans and easily parsable by computers.
Date representation sort in the same order alphabetically and chronically.
Support for fractional seconds.
ISO 8601 supersedes the previous ISO standards 2014, 2015, 2711, 3307 and 4031.
ISO 8601 defines that a week begins on a Monday (not a Sunday!).
A year's first week includes both January 4th and the first Thursday of the Year.
In other words, if a Year's first Monday falls on January 2nd, 3rd, or 4th, the preceding days of the January are part of the last week of the preceding year.
Week numbers range from 1 to 53.
Periods
ISO 8601 allows also to specify durations and repeating intervals.
Two specific dates are separated with a slash: 20170828T0123456/20180102T543210.
Periods (durations) without a specific start or end date start with a P.
JavaScript
In JavaScript, the value of a Date object can be represented in ISO 8601 using the toISOString() method new Date().toISOString().