Jump to content

Template:Start date: Difference between revisions

From Rave Wiki
Created page with "<includeonly><time class="dtstart" datetime="{{#time:c|{{{1}}}-{{{2|01}}}-{{{3|01}}} {{{4|00}}}:{{{5|00}}}:{{{6|00}}} {{{7|+00:00}}}}}"> {{#if:{{{3|}}} |{{#if:{{{2|}}} |{{#time:F j, Y|{{{1}}}-{{{2}}}-{{{3}}}}} |{{#time:F Y|{{{1}}}-{{{2|01}}}-01}} }} |{{#time:Y|{{{1}}}}} }}</time></includeonly> <noinclude> == Usage == This template formats a start date in a Wikipedia-style format with a hidden ISO 8601 timestamp. === Syntax === <pre> {{Start date|year|month|da..."
 
No edit summary
Line 1: Line 1:
<includeonly><time class="dtstart" datetime="{{#time:c|{{{1}}}-{{{2|01}}}-{{{3|01}}} {{{4|00}}}:{{{5|00}}}:{{{6|00}}} {{{7|+00:00}}}}}">
<includeonly>
{{#if:{{{3|}}}
{{#ifeq:{{{3|}}}||
|{{#if:{{{2|}}}
  {{#if:{{{2|}}}||
  |{{#time:F j, Y|{{{1}}}-{{{2}}}-{{{3}}}}}
    {{#time:F Y|{{{1}}}-{{{2|1}}}-1}}
  |{{#time:F Y|{{{1}}}-{{{2|01}}}-01}}
  |
    {{#time:F j, Y|{{{1}}}-{{{2}}}-{{{3}}}}}
   }}
   }}
|{{#time:Y|{{{1}}}}}
|
}}</time></includeonly>
  {{#time:Y|{{{1}}}}}
}}
</includeonly>


<noinclude>
<noinclude>
== Usage ==
== Template:Start date ==
This template formats a start date in a Wikipedia-style format with a hidden ISO 8601 timestamp.


=== Syntax ===
Formats a start date in a Wikipedia-style human-readable form.
 
=== Usage ===
<pre>
<pre>
{{Start date|year|month|day|hour|minute|second|timezone}}
{{Start date|year|month|day}}
</pre>
</pre>


=== Parameters ===
=== Examples ===
* {{{1}}} = Year (required)
 
* {{{2}}} = Month (optional)
<pre>
* {{{3}}} = Day (optional)
{{Start date|2026}}
* {{{4}}} = Hour (optional)
</pre>
* {{{5}}} = Minute (optional)
→ 2026
* {{{6}}} = Second (optional)
* {{{7}}} = Timezone (optional, default +00:00)


=== Examples ===
<pre>
<pre>
{{Start date|2026|04|25}}
{{Start date|2026|4}}
</pre>
</pre>
→ April 25, 2026
→ April 2026


<pre>
<pre>
{{Start date|2026|04|25|14|30}}
{{Start date|2026|4|25}}
</pre>
</pre>
→ April 25, 2026 (with time included in metadata)
→ April 25, 2026


=== Notes ===
=== Notes ===
* Outputs a machine-readable `<time>` tag for semantic SEO and microformats.
* Month and day are optional.
* Similar in concept to Wikipedia’s `{{Start date}}` / `{{Start date and age}}`.
* Designed for clean display (no broken ISO or time complexity).
</noinclude>
</noinclude>

Revision as of 23:33, 25 April 2026


Template:Start date

Formats a start date in a Wikipedia-style human-readable form.

Usage

{{Start date|year|month|day}}

Examples

{{Start date|2026}}

→ 2026

{{Start date|2026|4}}

→ April 2026

{{Start date|2026|4|25}}

→ April 25, 2026

Notes

  • Month and day are optional.
  • Designed for clean display (no broken ISO or time complexity).