Template:YMD to ISO

From imedwiki
Jump to navigation Jump to search

Script error: No such module "YMD to ISO".

Template documentation[view] [edit] [history] [purge]

Lua error in Module:Lua_banner at line 113: attempt to index field 'edit' (a nil value).

Template: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

{{YMD to ISO | <date in YMD format> }}

Examples

Full month names

  • {{YMD to ISO| 2000 January 17 }}Script error: No such module "YMD to ISO".
  • {{YMD to ISO|2000 February 29}}Script error: No such module "YMD to ISO".
  • {{YMD to ISO|2001 February 28}}Script error: No such module "YMD to ISO".
  • {{YMD to ISO|2000 december 17}}Script error: No such module "YMD to ISO".
  • {{YMD to ISO|2000 DECEMBER 17}}Script error: No such module "YMD to ISO".

Abbreviated month names

  • {{YMD to ISO|2000 Sep 1}}Script error: No such module "YMD to ISO".
  • {{YMD to ISO|2000 Sept 1}}Script error: No such module "YMD to ISO".
  • {{YMD to ISO|2000 Sept. 1}}Script error: No such module "YMD to ISO".
  • {{YMD to ISO|2000 dec 1}}Script error: No such module "YMD to ISO".
  • {{YMD to ISO|2000 DEC. 1}}Script error: No such module "YMD to ISO".

Dates in other formats (unchanged)

  • {{YMD to ISO|1 December 2000}}Script error: No such module "YMD to ISO".
  • {{YMD to ISO|December 1, 2000}}Script error: No such module "YMD to ISO".

Used as input

With the {{#time}} parser function:

  • {{#time: r|{{YMD to ISO|2000 January 17}}}}Error: Invalid time.
  • without {{YMD to ISO}}: {{#time: r|2000 January 17}}Error: Invalid time.

With the {{Date}} template:

  • {{Date|{{YMD to ISO|2000 January 17}}|dmy}}Script error: No such module "YMD to ISO".
  • without {{YMD to ISO}}: {{Date|2000 January 17|dmy}} → 2000 January 17 (not converted to dmy)

With the {{ISO date}} template:

See also

Date and time templates
[edit] all subsections that follow:

Multiple units of time

Type Adjustable Current Last Next
Date and time {{time}} {{Currentdate}} (MDY)
{{Plain now}} (DMY)
{{Now}} (DMY in a complete sentence)
{{Simple now}}
Date only {{Dateonly}}
{{Datedow}}
(Has the day of the week)
{{Date}} (Chose format)
{{DATE}} (prefixed by date=)
{{TODAY}} (DMY)
{{Yesterday}}
{{Day-1}}
{{Tomorrow}}
{{Day+1}}
Time only {{Timeonly}} {{CURRENTTIME}} (12 h format)
{{CURRENTTIME24}} (24 h format)
Banners {{Right now}}
(Blue with time and number of Wikipedia articles)
Timestamp {{Timestamp}}
(Format YYYYMMDDhhmmss)

Single units of time

Unit of time Adjustable Current Last Next
SECOND {{CURRENTSECOND}}
MINUTE {{CURRENTMINUTE}}
HOUR {{CURRENTHOUR}}
WEEK {{CURRENTWEEK}}
{{CURRENTWEEKOFMONTH}}
Day of Week {{Dow}} {{CURRENTDAYNAME}}
{{CURRENTWEEKDAYABBREV}}
{{CURRENTWEEKDAY}}
MONTH {{MONTHNAME}}
{{MONTHABBREV}}
{{MONTHNUMBER}}
{{MONTH}} (zero padded)
{{CURRENTMONTHNAME}}
{{CURRENTMONTHABBREV}}
{{CURRENTMONTH1}}
{{CURRENTMONTHDAYS}}
{{LASTMONTH}}
(Can make not zero-padded)
{{LASTMONTHNAME}}
{{NEXTMONTHNAME}}
Day of Month {{CURRENTDAY}}
{{CURRENTDAY2}} (zero padded)
YEAR {{CURRENTYEARCC}}
{{CURRENTYEARYY}}
{{CURRENTISOYEAR}}
{{CURRENTYEAR}}
{{LASTYEAR}} {{NEXTYEAR}}
Day of Year {{CURRENTDAYOFYEAR}}
DECADE {{DECADE}} {{CURRENTDECADE}}
CENTURY {{CENTURY}} {{CURRENTCENTURY}}
MILLENNIUM {{MILLENNIUM}} {{CURRENTMILLENNIUM}}

Date and time templates made for substitution:

Month:
{{Lmonth}} produces Oct
{{Nmonth}} produces Dec
{{LastMonth}} produces October 2024
{{NextMonth}} produces December 2024


Individual templates

Categories of templates

This template is based (in parts) on the Template:YMD to ISO from the free encyclopedia wikipedia and is licensed under GNU license for free documentation and the Creative Commons Attribution/Share Alike. On wikipedia there is a List of authors accessible. More about importing from wikipedia on page Imedwiki:Importing from wikipedia.