Aus Kitakien
(Unterschied zwischen Versionen)
|
|
Zeile 9: |
Zeile 9: |
| | | |
| [[Kategorie:Vorlage:Datumsberechnung|Wochentag]] | | [[Kategorie:Vorlage:Datumsberechnung|Wochentag]] |
- | </noinclude><!-- | + | </noinclude>{{#expr:({{{1|}}} |
- | | + | +{{#switch:{{{2|}}} |
- | Parameter: {{{1}}} Tag; {{{2}}} Monat; {{{3}}} Jahr.
| + | | 1 | 10 = 0 |
- | -->
| + | | 5 = 1 |
- | {{#switch: | + | | 8 = 2 |
- | | + | | 2 | 3 | 11 = 3 |
- | {{#expr: ( {{#switch:{{LOCALMONTH}} <!--Berechnung der Differenz von heutigem Datum und gefragtem Datum in Tagen--> | + | | 6 = 4 |
- | |01 = 0
| + | | 9 | 12 = 5 |
- | |02 = 31 <!--Tage bis 1. Februar-->
| + | | 4 | 7 = 6 |
- | |03 = 59 <!--Tage bis 1. März-->
| + | }} |
- | |04 = 90 <!--usw.-->
| + | +{{{3|0}}}mod 100 + (({{{3|0}}}mod 100 +26)/4 round 0) |
- | |05 = 120
| + | +(3-(({{{3|}}}-50)/100 round 0) mod 4)*2 |
- | |06 = 151
| + | -({{{2|0}}}<3)*(({{{3|0}}}mod 4=0)*{{{3|0}}} mod 100 or ({{{3|0}}}mod 400=0)) |
- | |07 = 181
| + | ) mod 7 |
- | |08 = 212
| + | |
- | |09 = 243
| + | |
- | |10 = 273
| + | |
- | |11 = 304
| + | |
- | |12 = 334
| + | |
- | }}
| + | |
- | + {{LOCALDAY}} | + | |
- | + {{LOCALYEAR}} - {{{3}}}
| + | |
- | + ({{LOCALYEAR}}-{{LOCALYEAR}}mod4-{{{3}}}+{{{3}}}mod4)/4 <!--Hinzufügen von Schalttagen--> | + | |
- | - ({{LOCALYEAR}}-{{LOCALYEAR}}mod100-{{{3}}}+{{{3}}}mod100)/100 | + | |
- | + ({{LOCALYEAR}}-{{LOCALYEAR}}mod400-{{{3}}}+{{{3}}}mod400)/400
| + | |
- | + {{#ifexpr: {{{3}}}mod4=0 and {{{2}}}<=2 |1 |0 }} <!--Korrektur (evtl. ist ein Schalttag zu viel berechnet worden)-->
| + | |
- | - {{#ifexpr: {{{3}}}mod100=0 and {{{2}}}<=2 |1 |0 }}
| + | |
- | + {{#ifexpr: {{{3}}}mod400=0 and {{{2}}}<=2 |1 |0 }}
| + | |
- | + 364 - {{#switch: {{{2}}}
| + | |
- | |01 = 0
| + | |
- | |02 = 31 <!--Tage bis 1. Februar-->
| + | |
- | |03 = 59 <!--Tage bis 1. März-->
| + | |
- | |04 = 90 <!--usw.-->
| + | |
- | |05 = 120
| + | |
- | |06 = 151
| + | |
- | |07 = 181
| + | |
- | |08 = 212
| + | |
- | |09 = 243
| + | |
- | |10 = 273
| + | |
- | |11 = 304
| + | |
- | |12 = 334
| + | |
- | }}
| + | |
- | - {{{1}}}) mod 7 }} <!--Differenz Rest 7 ergibt den Wochentag-->
| + | |
- | | + | |
- | |0 = {{LOCALDOW}}
| + | |
- | |1 = {{#ifexpr: {{LOCALDOW}}>=1 |{{#expr:{{LOCALDOW}}-1}} |{{#expr:{{LOCALDOW}}+6}} }}
| + | |
- | |2 = {{#ifexpr: {{LOCALDOW}}>=2 |{{#expr:{{LOCALDOW}}-2}} |{{#expr:{{LOCALDOW}}+5}} }}
| + | |
- | |3 = {{#ifexpr: {{LOCALDOW}}>=3 |{{#expr:{{LOCALDOW}}-3}} |{{#expr:{{LOCALDOW}}+4}} }}
| + | |
- | |4 = {{#ifexpr: {{LOCALDOW}}>=4 |{{#expr:{{LOCALDOW}}-4}} |{{#expr:{{LOCALDOW}}+3}} }}
| + | |
- | |5 = {{#ifexpr: {{LOCALDOW}}>=5 |{{#expr:{{LOCALDOW}}-5}} |{{#expr:{{LOCALDOW}}+2}} }}
| + | |
- | |6 = {{#ifexpr: {{LOCALDOW}}>=6 |{{#expr:{{LOCALDOW}}-6}} |{{#expr:{{LOCALDOW}}+1}} }}
| + | |
| }} | | }} |
Version vom 08:59, 10. Jan. 2008
Eingabe:
{{Wochentag|1|1|1970}}
(Tag|Monat|Jahr)
Ausgabe:
0 (Sonntag), 1 (Montag), 2 (Dienstag), 3 (Mittwoch), 4 (Donnerstag), 5 (Freitag), 6 (Samstag) 0