Calendar date


A calendar date is a reference to a particular day, represented within a calendar system, enabling a specific day to be unambiguously identified. Simple math can be performed between dates; commonly, the number of days between two dates may be calculated, e.g., "25 " is ten days after "15 ". The date of a particular event depends on the time zone used to record it. For example, the air attack on Pearl Harbor that began at 7:48 a.m. local Hawaiian time on 7 December 1941 is recorded equally as having happened on 8 December at 3:18 a.m. Japan Standard Time.
A particular day may be assigned a different nominal date according to the calendar used. The de facto standard for recording dates worldwide is the Gregorian calendar, the world's most widely used civil calendar. Many cultures use religious calendars such as the Gregorian, the Julian calendar, Hebrew calendar, the Hijri calendars, or any other of the many calendars used around the world. Regnal calendars are also used in some places, for particular purposes.
In most calendar systems, the date consists of three parts: the day of the month, the month, and the year. There may also be additional parts, such as the day of the week. Years are counted from a particular starting point called the epoch, with era referring to the span of time since that epoch. A date without the year may also be referred to as a date or calendar date. As such, it is either shorthand for the current year, or else it defines the day of an annual event such as a birthday on 25 March or Christmas on 25 December.

Date format

A large variety of formats for dates is in use in line with differing national or other convention, that differ according to the order of date element and separators. For example the date "" can be written as , , (YMD convention

Gregorian, day–month–year (DMY)

This little-endian sequence is used by a majority of the world and is the preferred form by the United Nations when writing the full date format in official documents. This date format originates from the custom of writing the date as "the Nth day of in the year of our Lord " in Western religious and legal documents. The format has shortened over time but the order of the elements has remained constant. The following examples use the date of 25 March 1995. In the case of two-digit years, care must be taken to ensure that they are not interpreted as belonging to a different century. The dots function as ordinal dots.
  • 25 March 1995
  • 25/3/1995 or 25/03/1995
  • 25.3.1995 or 25.03.1995
  • 25. 3. 1995 or 25. 03. 1995
  • 25-3-1995 or 25-03-1995
  • 25-Mar-1995
  • 25Mar95 – Used, including in the U.S., where space needs to be saved by skipping punctuation.
  • 25th March 1995 – 'The' and 'of' are often spoken but generally omitted in all but the most formal writing such as legal documents.
  • 25/Mar/1995 – used in the Common Log Format
  • Saturday, 25 March 1995
  • 25/iii/95, 25.iii.95, 25-iii.95, 25/iii-95, 25.III.1995, 25. III. 1995 or 25 III 1995 – In the past, this was a common and typical way of distinguishing day from month and was widely used in many countries, but recently this practice has been affected by the general retreat from the use of Roman numerals. This is usually confined to handwriting only and is not put into any form of print. It is associated with a number of schools and universities. It has also been used by the Vatican as an alternative to using months named after Roman deities. It is used on Canadian postmarks as a bilingual form of the month. It was also commonly used in the Soviet Union, in both handwriting and print.
  • 25 March 1995 CE or 25 March 1995 AD

    Gregorian, year–month–day (YMD)

In this format, the most significant data item is written before lesser data items i.e. the year before the month before the day. It is consistent with the big-endianness of the Hindu–Arabic numeral system, which progresses from the highest to the lowest order magnitude. That is, using this format textual orderings and chronological orderings are identical. This form is standard in East Asia, Iran, Lithuania, Hungary, and Sweden; and some other countries to a limited extent.
Examples for the 25th of March 1995:
  • 1995-03-25: the standard Internet date/time format, a profile of the international standard ISO 8601, orders the components of a date like this, and additionally uses leading zeros, for example, 1995-03-25, to be easily read and sorted by computers. It is used with UTC in RFC 3339. This format is also favored in certain Asian countries, mainly East Asian countries, as well as in some European countries. The big-endian convention is also frequently used in Canada, but all three conventions are used there.
  • 1995 March 25
  • 1995Mar25
  • 1995-Mar-25
  • 1995-Mar-25, Saturday
  • 1995. 25. – The official format in Hungary, point after year and day, month name with small initial. Following shorter formats also can be used: 1995.. 25., 1995. 03. 25., 1995. III. 25.
  • 1995.3.25 or 1995.03.25
  • 1995/3/25 or 1995/03/25
  • 1995/3/25 or 1995/03/25
  • 95/3/25 or 95/03/25
  • 19950325 : the "basic format" profile of ISO 8601, an 8-digit number providing monotonic date codes, common in computing and increasingly used in dated computer file names. It is used in the standard iCalendar file format defined in RFC 5545.
It is also extended through the universal big-endian format clock time: 1995 March 25, 18h 14m 12s, or 1995/03/25/18:14:12 or 1995-03-25T18:14:12.

Gregorian, month–day–year (MDY)

This sequence is used primarily in the Philippines and the United States. It is also used to varying extents in Canada. This date format was commonly used alongside the little-endian form in the United Kingdom until the mid-20th century and can be found in both defunct and modern print media, such as the London Gazette and The Times, respectively. This format was also commonly used by several English-language print media in many former British colonies and also one of two formats commonly used in India during British Raj era until the mid-20th century.
  • Saturday, March 25, 1995
  • March 25, 1995
  • Mar 25, 1995
  • Mar-25-1995
  • Mar-25-1995
  • 3/25/1995 or 03/25/1995
  • 3-25-1995 or 03-25-1995
  • 3.25.1995 or 03.25.1995
  • 3.25.95 or 03.25.95
  • 3/25/95 or 03/25/95
Modern style guides recommend avoiding the use of the ordinal form of numbers when the day follows the month, and that format is not included in ISO standards. The ordinal was common in the past and is still sometimes used.

Gregorian, year–day–month (YDM)

This date format is used in Kazakhstan, Latvia, Nepal, and Turkmenistan. According to the official rules of documenting dates by governmental authorities, the long date format in Kazakh is written in the year–day–month order, e.g. 1995 25 March. However, both Latvia and Kazakhstan use the day-month-year format for all-numeric dates. None of these four countries use the all-numeric date format YYYY.DD.MM

Standards

There are several standards that specify date formats:
  • ISO 8601 Data elements and interchange formats – Information interchange – Representation of dates and times specifies YYYY-MM-DD, where all values are fixed length numeric, but also allows YYYY-DDD, where DDD is the ordinal number of the day within the year, e.g. 2001–365.
  • RFC 3339 Date and Time on the Internet: Timestamps specifies YYYY-MM-DD, i.e. a particular subset of the options allowed by ISO 8601.
  • RFC 5322 Internet Message Format specifies day month year where day is one or two digits, month is a three letter month abbreviation, and year is four digits.

    Difficulties

Many numerical forms can create confusion when used in international correspondence, particularly when abbreviating the year to its final two digits, with no context. For example, "07/08/06" could refer to either 7 August 2006 or July 8, 2006, or 2007 August 6.
The date format of YYYY-MM-DD in ISO 8601, as well as other international standards, have been adopted for many applications for reasons including reducing transnational ambiguity and simplifying machine processing.
An early U.S. Federal Information Processing Standard recommended 2-digit years. This is now widely recognized as extremely problematic, because of the year 2000 problem. Some U.S. government agencies now use ISO 8601 with 4-digit years.
When transitioning from one calendar or date notation to another, a format that includes both styles may be developed; for example Old Style and New Style dates in the transition from the Julian to the Gregorian calendar.

Advantages for ordering in sequence

One of the advantages of using the ISO 8601 date format is that the lexicographical order of the representations is equivalent to the chronological order of the dates, assuming that all dates are in the same time zone. Thus dates can be sorted using simple string comparison algorithms, and indeed by any left to right collation. For example:
2003-02-28 sorts before
2006-03-01 which sorts before
2015-01-30
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. 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.