Vorlage:Date: Unterschied zwischen den Versionen

Aus IntactiWiki
Zur Navigation springen Zur Suche springen
(Die Seite wurde neu angelegt: „{{{{{|safesubst:}}}#switch:none |{{{{{|safesubst:}}}#iferror: {{{{{|safesubst:}}}#time:Y_M_d|{{{1|}}} }} | none }} <noinclude><!-- #time: can't handle --></no…“)
 
K
 
(2 dazwischenliegende Versionen desselben Benutzers werden nicht angezeigt)
Zeile 1: Zeile 1:
{{{{{|safesubst:}}}#switch:none
+
<includeonly>{{#switch:{{#invoke:String|len|s={{{1}}}}}
|{{{{{|safesubst:}}}#iferror: {{{{{|safesubst:}}}#time:Y_M_d|{{{1|}}} }} | none }} <noinclude><!-- #time: can't handle --></noinclude>
+
  |1 |2 |3 |4 |5 = {{#time:Y|{{{1}}} }}
  |{{{{{|safesubst:}}}#iferror: {{{{{|safesubst:}}}#expr: {{{1|}}}+0 }}
+
  |6 |7 |8 = {{#time:F Y|{{{1}}} }}
    |<noinclude><!--not a pure number--></noinclude>
+
  |9 |10 = {{#time:j. F Y|{{{1}}} }}
    |{{{{{|safesubst:}}}#ifexpr: {{{1|}}}+0 > 10000000000000
+
  |#default = <strong class="error">Fehler</strong>[[Kategorie:Seiten mit Datum-Formatfehlern]]
      |<noinclude><!-- a yyyymmddhhmmss timestamp --></noinclude>
+
}}</includeonly><noinclude>== Nutzung ==
      |{{{{{|safesubst:}}}#ifeq: {{{{{|safesubst:}}}#expr:{{{1|}}}+0}} | {{{1|}}}
+
Benutze in Vorlagen bitte das Format '''YYYY-MM-DD''' (z.B. 2001-05-01 oder 2018-12-28. Bitte nutze in Artikeltexten das Format '''DD MMMM YYYY''' (z.B. <q>1. Mai 2001</q> oder <q>24. Dezember 2018</q>). Du kannst natürlich die Vorlage auch außerhalb von Vorlagen in Artikeltexten nutzen, so wie hier:
          | none <noinclude><!-- pure number eg 123.456 --></noinclude>
+
<pre>* John Doe wurde am {{Date|1950-07-23}} geboren.</pre>
          | <noinclude><!-- assume yy-mm-dd --></noinclude>
+
* John Doe wurde am {{Date|1950-07-23}} geboren.
        }}
 
    }}
 
  }}
 
  |{{{{{|safesubst:}}}#switch:  {{{{{|safesubst:}}}lc:{{{2|}}}}} | none | asis | link | lnone =none }}
 
|{{{{{|safesubst:}}}#ifexpr:  {{{{{|safesubst:}}}#time:Y|{{{1|}}} }} < 1000 | none }}
 
  |{{{{{|safesubst:}}}#switch:  {{{{{|safesubst:}}}#time:Ynj|{{{1|}}} }}|100031|110031|130031|140031|150031=none}}
 
  |= {{{{{|safesubst:}}}#if:{{{1|}}}
 
      |{{{{{|safesubst:}}}#switch:{{{2}}}
 
        |link|lnone|l=[[{{{1}}}]]
 
        |{{{1}}}
 
      }}
 
    }}<noinclude><!-- error or "none", so no formatting --></noinclude>
 
|<noinclude><!-- continue with formatting --></noinclude>
 
  {{{{{|safesubst:}}}#ifeq:<noinclude><!--
 
    --></noinclude>{{{{{|safesubst:}}}#time:Y|{{{1}}} 2008}}<noinclude><!--
 
    --></noinclude>{{{{{|safesubst:}}}#iferror: {{{{{|safesubst:}}}#ifexpr: {{{1}}}>10000000000000 | no }} | }}<noinclude><!--
 
    --></noinclude>{{{{{|safesubst:}}}#time:Y|{{{1}}} 2004}}
 
  |20082004
 
  |<noinclude><!-- no year --></noinclude>
 
    {{{{{|safesubst:}}}#ifeq:{{{{{|safesubst:}}}#time:d|{{{1}}} 2036}}|{{{{{|safesubst:}}}#time:d|{{{1}}} }}
 
    |<noinclude><!-- month+day --></noinclude>{{{{{|safesubst:}}}#time:
 
      {{{{{|safesubst:}}}#switch: {{{{{|safesubst:}}}lc: {{{{{|safesubst:}}}#ifeq:{{{3|}}}|y|L}}{{{2|}}} }}
 
      | lmdy | liso | lymd      = [[:F j]]
 
      | mdy  | iso  | ymd      = F j
 
      | ldmy | l                = [[:j F]]
 
      | #default                = j F
 
      }}|{{{1}}} 2000 }}<noinclude><!-- default='dmy' or null or "" or unsupported option --></noinclude>
 
    |<noinclude><!-- month only --></noinclude>{{{{{|safesubst:}}}#time:
 
      {{{{{|safesubst:}}}#switch: {{{{{|safesubst:}}}lc: {{{{{|safesubst:}}}#ifeq:{{{3|}}}|y|L}}{{{2|}}} }}
 
      | lmdy | liso | lymd
 
      | ldmy | l                = [[F]]
 
      | #default                = F
 
      }}|{{{1}}} 2000 }}<noinclude><!-- default='dmy'/'mdy'/'ymd'/'iso'/null/""/unsupported opt --></noinclude>
 
    }}
 
  |<noinclude><!-- with year--></noinclude>
 
    {{{{{|safesubst:}}}#if: {{{{{|safesubst:}}}#iferror:{{{{{|safesubst:}}}#time:j|2 {{{1|}}}}}|*D*|{{{{{|safesubst:}}}#iferror:{{{{{|safesubst:}}}#time:j|2000 {{{1|}}}}}|*D*| }}}}
 
    |<noinclude><!-- day+month+year --></noinclude>{{{{{|safesubst:}}}#time:
 
      {{{{{|safesubst:}}}#switch: {{{{{|safesubst:}}}lc: {{{{{|safesubst:}}}#ifeq:{{{3|}}}|y|L}}{{{2|}}} }}
 
      | lmdy                    = [[:F j]], [[Y]]
 
      | mdy                    = F j, Y
 
      | liso                    = [[Y|Y-]][[F j|m-d]]<noinclude><!-- i.e. [[Y-m-d]] --></noinclude>
 
      | iso                    = Y-m-d
 
      | lymd                    = [[Y]] [[:F j]]
 
      | ymd                    = Y F j
 
      | ldmy | l                = [[:j F]] [[Y]]
 
      | #default                = j F Y
 
      }}|{{{1|}}} }}<noinclude><!-- #default='dmy' or null or "" or unsupported option --></noinclude>
 
    |<noinclude><!-- month+year --></noinclude>{{{{{|safesubst:}}}#time:
 
      {{{{{|safesubst:}}}#switch: {{{{{|safesubst:}}}lc: {{{{{|safesubst:}}}#ifeq:{{{3|}}}|y|L}}{{{2|}}} }}
 
      | lmdy | liso | lymd | ldmy | l  = [[:F Y]]
 
      | #default                = F Y
 
      }}|{{{1|}}} }}<noinclude><!-- default='dmy'/'iso'/'mdy'/null/""/unsupported option --></noinclude>
 
    }}
 
  }}   
 
}}<noinclude>
 
  
This internal template must not be used in articles, but only in templates! It is identical to the one being used in the Wikipedia (state: {{date|2019-09-27}}).
+
== Beispiele ==
 +
<pre>{{Date|}}
 +
{{Date|999}}
 +
{{Date|2019}}
 +
{{Date|2019-}}</pre>
 +
* {{Date|}}
 +
* {{Date|999}}
 +
* {{Date|2019}}
 +
* {{Date|2019-}}
 +
<pre>{{Date|2019-3}}
 +
{{Date|2019-03}}
 +
{{Date|2019-03-}}
 +
{{Date|03-2019}}</pre>
 +
* {{Date|2019-3}}
 +
* {{Date|2019-03}}
 +
* {{Date|2019-03-}}
 +
* {{Date|03-2019}}
 +
<pre>{{Date|2019-12-1}}
 +
{{Date|2019-12-24}}
 +
{{Date|2019-12-999}}
 +
{{Date|01-03-2019}}</pre>
 +
* {{Date|2019-12-1}}
 +
* {{Date|2019-12-24}}
 +
* {{Date|2019-12-999}}
 +
* {{Date|01-03-2019}}
  
[https://en.wikipedia.org/wiki/Template:Date/doc Click here for the documentation.]</noinclude>
+
[[en:Template:Date]]
 +
</noinclude>

Aktuelle Version vom 4. November 2019, 21:29 Uhr

Nutzung

Benutze in Vorlagen bitte das Format YYYY-MM-DD (z.B. 2001-05-01 oder 2018-12-28. Bitte nutze in Artikeltexten das Format DD MMMM YYYY (z.B. 1. Mai 2001 oder 24. Dezember 2018). Du kannst natürlich die Vorlage auch außerhalb von Vorlagen in Artikeltexten nutzen, so wie hier:

* John Doe wurde am {{Date|1950-07-23}} geboren.
  • John Doe wurde am 23. Juli 1950 geboren.

Beispiele

{{Date|}}
{{Date|999}}
{{Date|2019}}
{{Date|2019-}}
  • Fehler
  • Fehler: Ungültige Zeitangabe
  • 2019
  • Fehler: Ungültige Zeitangabe
{{Date|2019-3}}
{{Date|2019-03}}
{{Date|2019-03-}}
{{Date|03-2019}}
  • März 2019
  • März 2019
  • Fehler: Ungültige Zeitangabe
  • Fehler: Ungültige Zeitangabe
{{Date|2019-12-1}}
{{Date|2019-12-24}}
{{Date|2019-12-999}}
{{Date|01-03-2019}}
  • 1. Dezember 2019
  • 24. Dezember 2019
  • Fehler
  • 1. März 2019