News (06 Aug 2024): Das Wiki läuft jetzt auf einem neuen Server. Aufgrund eines Upgrades von PHP mussten die Wiki-Software und die DPL-Erweiterung aktualisiert werden. Bitte meldet Fehler auf der Hauptseiten-Diskussion.

Benutzer:Tobias Xy/Vorlage2: Unterschied zwischen den Versionen

Aus GuildWiki
Zur Navigation springenZur Suche springen
Keine Bearbeitungszusammenfassung
(ganz schön anspruchsvoll :D)
Zeile 1: Zeile 1:
<div style="display:none;">
<div style="display:none;">
{{#vardefine:mon_1|31}}
{{#vardefine:year|{{{1|2000}}} }}
{{#vardefine:mon_2|28}}
{{#vardefine:month|{{{2|12}}} }}
{{#vardefine:mon_3|31}}
{{#vardefine:day|{{{3|12}}} }}
{{#vardefine:mon_4|30}}
{{#vardefine:hour|{{{4|0}}} }}
{{#vardefine:mon_5|31}}
{{#vardefine:minute|{{{5|0}}} }}
{{#vardefine:mon_6|30}}
{{#vardefine:second|{{{6|0}}} }}
{{#vardefine:mon_7|31}}
{{#vardefine:mon_8|31}}
{{#vardefine:mon_9|30}}
{{#vardefine:mon_10|31}}
{{#vardefine:mon_11|30}}
{{#vardefine:mon_12|31}}<!--sollte nie gebraucht werden :D -->
{{#vardefine:years|{{#expr:{{{1}}}-1971}} }}
{{#vardefine:months|{{#expr:{{{2}}}-1}} }}
{{#vardefine:days|{{#expr:{{{3}}}-1}} }}


<!-- Schaltjahre mit einbeziehen-->
{{#vardefine:is_leap|0}}
{{#vardefine:unix|0}}
{{#vardefine:i|1970}}
{{#vardefine:i|1970}}
{{#vardefine:leap_days|0}}
{{#while:  
{{#while:  
|{{#ifexpr:({{#var:i}} < {{{1}}}) or ({{{2}}} > 2 and {{#var:i}} <= {{{1}}}) |true}}
|{{#ifexpr: {{#var:i}} < {{#var:year}} | true}}
|{{#ifexpr: {{#var:i}}%4 = 0 and ({{#var:i}}%100 != 0 or {{#var:i}}%400 = 0)|{{#vardefine:leap_days|{{#expr:{{#var:leap_days}}+1}}}}}}
|{{#ifexpr: {{#var:i}} mod 4 = 0 and ({{#var:i}} mod 100 != 0 or {{#var:i}} mod 400 = 0)
  |{{#vardefine:unix|{{#expr:{{#var:unix}}+366*24*60*60}} {{#vardefine:is_leap|1}} }}
  |{{#vardefine:unix|{{#expr:{{#var:unix}}+365*24*60*60}} }}
}}
{{#vardefine:i|{{#expr:{{#var:i}}+1}} }}
}}
}}


{{#vardefine:i|1}}
{{#vardefine:i|1}}
{{#vardefine:mon_days|0}}
 
{{#while:  
{{#while:  
|{{#ifexpr: {{#var:i}} <= {{#var:months}} |true}}
|{{#ifexpr: {{#var:i}} < {{#var:month}} | true}}
|{{#vardefine:mon_days|{{#expr:{{#var:mon_days}}+{{#var:mon_{{#var:i}} }} }} }}
|{{#ifexpr: {{#var:i}} = 1 or {{#var:i}} = 3 or {{#var:i}} = 5 or {{#var:i}} = 7 or {{#var:i}} = 8 or {{#var:i}} = 10 or {{#var:i}} = 12
  |{{#vardefine:unix|{{#expr:{{#var:unix}}+31*24*60*60}} }}
}}
{{#ifexpr: {{#var:i}} = 4 or {{#var:i}} = 6 or {{#var:i}} = 9 or {{#var:i}} = 11
  |{{#vardefine:unix|{{#expr:{{#var:unix}}+30*24*60*60}} }}
}}
{{#ifexpr: {{#var:i}} = 2
  |{{#ifexpr: {{#var:is_leap}} = 1
      |{{#vardefine:unix|{{#expr:{{#var:unix}}+29*24*60*60}} }}
      |{{#vardefine:unix|{{#expr:{{#var:unix}}+28*24*60*60}} }}
    }}
}}
{{#vardefine:i|{{#expr:{{#var:i}}+1}} }}
{{#vardefine:i|{{#expr:{{#var:i}}+1}} }}
}}
}}
</div>
 
{{#var:years}} /
{{#vardefine:unix|{{#expr:{{#var:unix}}+({{#var:day}}-1)*24*60*60}} }}
{{#var:mon_days}} /
{{#vardefine:unix|{{#expr:{{#var:unix}}+({{#var:hour}}-1)*60*60}} }}
{{#var:days}} /
{{#vardefine:unix|{{#expr:{{#var:unix}}+{{#var:minute}}*60}} }}
{{#var:leap_days}} /
{{#vardefine:unix|{{#expr:{{#var:unix}}+{{#var:second}}}} }}
{{#expr:{{#var:years}}*365*24*60*60 + ({{#var:mon_days}}+{{#var:days}}+{{#var:leap_days}})*24*60*60}}
 
</div>{{#var:unix}}

Version vom 7. Dezember 2009, 20:14 Uhr











976575600