ISO 8601 represents a date as YYYY-MM-DD
.
It doesn't seem to offer any recommendation on how to represent a date range, for example:
2013-01-01 => 2013-06-31
Does ISO 8601, or another standard, give a sensible recommendation for representing date ranges?
Background: this is to be used as the output of the toString()
method of a DateRange
object, output which could then be parsed with a parse()
method.
Ranges. A simple year–year range is written using an en dash ( – , – or {{ndash}} ), not an em dash, hyphen, or slash; this dash is unspaced (that is, with no space on either side); and the end year is usually given in full: 1881–1882; 1881–1886 (not 1881–86); 1881–1992 (not 1881–92)
The United States is one of the few countries that use “mm-dd-yyyy” as their date format–which is very very unique! The day is written first and the year last in most countries (dd-mm-yyyy) and some nations, such as Iran, Korea, and China, write the year first and the day last (yyyy-mm-dd).
ISO 8601 represents date and time by starting with the year, followed by the month, the day, the hour, the minutes, seconds and milliseconds. For example, 2020-07-10 15:00:00.000, represents the 10th of July 2020 at 3 p.m. (in local time as there is no time zone offset specified—more on that below).
The international standard date notation is. YYYY-MM-DD. where YYYY is the year in the usual Gregorian calendar, MM is the month of the year between 01 (January) and 12 (December), and DD is the day of the month between 01 and 31.
ISO 8601 does have a standard for representing date ranges. To represent the start and end date using this format you would write:
2013-01-01/2013-06-31
Note how the forward slash is used as the interval designator to separate the start and end dates.
See here for more information.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With