Difference between revisions of "Template:ISO8601"

From Wikispooks
Jump to navigation Jump to search
(link)
(link)
Line 8: Line 8:
 
}}
 
}}
 
</poem>
 
</poem>
</noinclude><includeonly>{{#substring:0000{{{DateYear|}}}|{{#expr: {{#strlen:{{{DateYear|}}}}} - 1}}|4}}-{{#substring:0{{{DateMonth|}}}|{{#expr: {{#strlen:{{{DateMonth|}}}}} - 1}}|2}}-{{#substring:0{{{DateDay|}}}|{{#expr: {{#strlen:{{{DateDay|}}}}} - 1}}|2}}</includeonly>
+
</noinclude><includeonly>{{#substring:0000{{{DateYear|}}}|{{#expr: {{#strlen:{{{DateYear|}}}}} - 0}}|4}}-{{#substring:0{{{DateMonth|}}}|{{#expr: {{#strlen:{{{DateMonth|}}}}} - 1}}|2}}-{{#substring:0{{{DateDay|}}}|{{#expr: {{#strlen:{{{DateDay|}}}}} - 1}}|2}}</includeonly>

Revision as of 03:23, 11 November 2013

Formats a date as ISO8601.
Usage:

{{ISO8601
|DateYear= (0-9999)
|DateMonth= (1-12)
|DateDay= (1-31)
}}