Jump to content

Template:YMD to ISO/doc

From Elite Dangerous Wiki

__EXPECTED_UNCONNECTED_PAGE__

{{YMD to ISO}} converts a date in YMD format (e.g. 2000 January 17) to ISO 8601 format (e.g. 2000-01-17). Any input which is not a valid DMY date is passed through unchanged. This template is designed to preprocess dates for use with the #time parser function, which is unable to convert YMD dates, and for use with templates such as {{Date}} or {{ISO date}} which are implemented using the #time parser function.

Usage

Examples

Full month names

Abbreviated month names

Dates in other formats (unchanged)

  • {{YMD to ISO|1 December 2000}} → 1 December 2000
  • {{YMD to ISO|December 1, 2000}} → December 1, 2000

Used as input

With the {{#time}} parser function:

  • {{#time: r|{{YMD to ISO|2000 January 17}}}} → Mon, 17 Jan 2000 00:00:00 +0000
  • without {{YMD to ISO}}: {{#time: r|2000 January 17}} → Error: Invalid time.

With the {{Date}} template:

  • {{Date|{{YMD to ISO|2000 January 17}}|dmy}} → 17 January 2000
  • without {{YMD to ISO}}: {{Date|2000 January 17|dmy}} → 2000 January 17 (not converted to dmy)

With the {{ISO date}} template:

  • {{ISO date|{{YMD to ISO|2000 January 17}}|dmy}} → 2000-01-17
  • without {{YMD to ISO}}: {{ISO date|2000 January 17|dmy}} → Error: Invalid time.

With non-existent dates (unchanged):

  • {{YMD to ISO|2013 February 29}} → 2013 February 29 (2013 was not a leap year)
  • {{YMD to ISO|2012 April 31}} → 2012 April 31 (April does not have 31 days)
  • {{YMD to ISO|2012 March 0}} → 2012 March 0 (valid day ranges are from 1-31)

See also

Date and time templates
For the magic words with the same or similar names, see MediaWikiWiki:Help:Magic words#Date and time.

Multiple units of time

Type Adjustable Current Last Next
Date and time
Date only
Month and year only
Time only
  • {{Timeonly}} (Adjustable to 12 h format)
Banners
  • {{Right now}}
    (Blue with time and number of Wikipedia articles)
Timestamp

Single units of time

Unit of time Adjustable Current Last Next
Second
Minute
Hour
Week
Day of Week
Month
Day of Month
Year
Day of Year
Decade
Century
Millenium

Date and time templates made for substitution

Parser functions

Individual templates

Categories of templates