Calendar Date - Advantages For Ordering in Sequence

Advantages For Ordering in Sequence

One of the advantages of using the ISO 8601 standard date format is that the lexicographical order (ASCIIbetical) of the representations is equivalent to the chronological order of the dates. Thus dates can be sorted using simple string comparison algorithms, and indeed by any left to right collation. For example:

1998-02-28 (28 February 1998) sorts before 1999-03-01 (1 March 1999) which sorts before 2000-01-30 (30 January 2000)

The YYYY-MM-DD layout is the only common format that can provide this. Sorting other date representations involves some parsing of the date strings. This also works when a time in 24-hour format is included after the date, as long as all times are understood to be in the same time zone.

ISO 8601 is used widely where concise, human readable yet easily computable and unambiguous dates are required, although many applications store dates internally as UNIX time and only convert to ISO 8601 for display. It is worth noting that all modern computer Operating Systems retain date information of files outside of their titles, allowing the user to choose which format they prefer and have them sorted thus, irrespective of the files' names.

Read more about this topic:  Calendar Date

Famous quotes containing the words advantages, ordering and/or sequence:

    To become aware in time when young of the advantages of age; to maintain the advantages of youth in old age: both are pure fortune.
    Johann Wolfgang Von Goethe (1749–1832)

    The national anthem belongs to the eighteenth century. In it you find us ordering God about to do our political dirty work.
    George Bernard Shaw (1856–1950)

    It isn’t that you subordinate your ideas to the force of the facts in autobiography but that you construct a sequence of stories to bind up the facts with a persuasive hypothesis that unravels your history’s meaning.
    Philip Roth (b. 1933)