Module

YMD to ISO/doc

From Dogcraft Wiki

(from wikipedia (https://en.wikipedia.org/w/index.php?title=Module:YMD_to_ISO/doc))
 
m (Text replacement - "{{tl|" to "{{template link|")
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{wikipedia|Module:YMD to ISO}}
<!-- Place categories where indicated at the bottom of this page. -->
<!-- Place categories where indicated at the bottom of this page. -->


'''{{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.
'''{{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 {{template link|Date}} or {{template link|ISO date}} which are implemented using the #time parser function.


== Usage ==
== Usage ==

Latest revision as of 23:07, 3 December 2023

Notice: This page uses content from Wikipedia. The original article was at Module:YMD to ISO. The list of authors can be seen in the page history.

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

{{#invoke:YMD to ISO | main | <date in YMD format> }}

or via template:

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

Examples

{{#invoke:YMD to ISO | main | 2000 January 17 }} → 2000-01-17

or via template:

{{YMD to ISO | 2000 January 17 }} → 2000-01-17

For more examples, see Template:YMD to ISO.

See also