MyWikiBiz, Author Your Legacy — Tuesday May 14, 2024
Jump to navigationJump to search
1,478 bytes added
, 08:01, 16 July 2021
<!-- Place categories where indicated at the bottom of this page and interwikis at Wikidata -->
'''{{NAMESPACE}}:{{BASEPAGENAME}}''' converts a date in [[Calendar date#Gregorian, year-month-day (YMD)|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 [[wikt:preprocess|preprocess]] dates for use with the [[Help:Time function|#time]] parser function, which is unable to convert YMD dates, and for use with templates such as {{tl|Date}} or {{tl|ISO date}} which are implemented using the #time parser function.
== Usage ==
<code><nowiki>{{</nowiki>#invoke:{{BASEPAGENAME}} | main | ''<date in YMD format>'' }}</code>
or via template:
<code><nowiki>{{</nowiki>{{BASEPAGENAME}} | ''<date in YMD format>'' }}</code>
== Examples ==
<code><nowiki>{{</nowiki>#invoke:{{BASEPAGENAME}}<nowiki> | main | 2000 January 17 }}</nowiki></code> → {{#invoke:{{BASEPAGENAME}} | main | 2000 January 17 }}
or via template:
<code><nowiki>{{</nowiki>{{BASEPAGENAME}}<nowiki> | 2000 January 17 }}</nowiki></code> → {{{{BASEPAGENAME}} | 2000 January 17 }}
For more examples, see [[Template:YMD to ISO]].
== See also ==
* [[Module:YMD to ISO/testcases]]
* [[Help:Time function]]
* {{Section link|mw:Help:Extension:ParserFunctions|#time}}
<includeonly>{{#ifeq:{{SUBPAGENAME}}|sandbox | |
<!-- Categories below this line; interwikis at Wikidata -->
}}</includeonly>