|
|
Line 1: |
Line 1: |
| <includeonly>{{#ifeq:{{#expr: {{#time:U}} < {{#if:{{{timecode|}}}|{{{timecode|}}}|{{#time:U|{{{year}}}-{{{month|1}}}-{{{day|1}}} {{{hour|00}}}:{{{minute|00}}}:{{{second|00}}}}}}}}}|1|There are {{#ifeq:{{#expr: {{#time:U}} < {{#if:{{{timecode|}}}|{{{timecode|}}}|{{#time:U|{{{year}}}-{{{month|1}}}-{{{day|1}}} {{{hour|00}}}:{{{minute|00}}}:{{{second|00}}}}}}} - 86399}}|1|'''<span style="color: {{{color|red}}}">{{#expr:( ( ( {{#if:{{{timecode|}}}|{{{timecode|}}}|{{#time:U|{{{year}}}-{{{month|1}}}-{{{day|1}}} {{{hour|00}}}:{{{minute|00}}}:{{{second|00}}}}}}} - {{#time:U}}) / 86400 ) -0.5) round 0}}</span>''' days|}} {{#ifeq:{{#expr: {{#time:U}} > {{#if:{{{timecode|}}}|{{{timecode|}}}|{{#time:U|{{{year}}}-{{{month|1}}}-{{{day|1}}} {{{hour|00}}}:{{{minute|00}}}:{{{second|00}}}}}}} - 3600}}|1|{{#ifeq: {{#expr: ( ( ( {{#if:{{{timecode|}}}|{{{timecode|}}}|{{#time:U|{{{year}}}-{{{month|1}}}-{{{day|1}}} {{{hour|00}}}:{{{minute|00}}}:{{{second|00}}}}}}} - {{#time:U}} ) / 60 ) - 0.5 ) round 0 }}|0|'''<span style="color: {{{color|red}}}">{{#expr: {{#if:{{{timecode|}}}|{{{timecode|}}}|{{#time:U|{{{year}}}-{{{month|1}}}-{{{day|1}}} {{{hour|00}}}:{{{minute|00}}}:{{{second|00}}}}}}} - {{#time:U}}}}</span>''' seconds |'''<span style="color: {{{color|red}}}">{{#expr: ( ( ( {{#if:{{{timecode|}}}|{{{timecode|}}}|{{#time:U|{{{year}}}-{{{month|1}}}-{{{day|1}}} {{{hour|00}}}:{{{minute|00}}}:{{{second|00}}}}}}} - {{#time:U}} ) / 60 ) - 0.5 ) round 0 }}</span>''' minutes}} |'''<span style="color: {{{color|red}}}">{{#expr:{{#expr: ( {{#if:{{{timecode|}}}|{{{timecode|}}}|{{#time:U|{{{year}}}-{{{month|1}}}-{{{day|1}}} {{{hour|00}}}:{{{minute|00}}}:{{{second|00}}}}}}} - {{#time:U}} ) / 3600 - ( ( ( ( ( ( {{#if:{{{timecode|}}}|{{{timecode|}}}|{{#time:U|{{{year}}}-{{{month|1}}}-{{{day|1}}} {{{hour|00}}}:{{{minute|00}}}:{{{second|00}}}}}}} - {{#time:U}}) / 86400 ) - 0.5 ) round 0 )* 24 ) -0.5 ) round 0}} - 1}}</span>''' hours}} left before {{{event|the event}}}.|{{#ifexist:{{{duration|}}}|{{#ifeq:{{#expr: ({{#if:{{{timecode|}}}|{{{timecode|}}}|{{#time:U|{{{year}}}-{{{month|1}}}-{{{day|1}}} {{{hour|00}}}:{{{minute|00}}}:{{{second|00}}}}}}} + {{{duration}}}) > {{#time:U}}}}|1|{{{eventstart|{{{event|the event}}} has already started.}}}|{{{eventend|{{{event|the event.}} has already ended}}}}}|{{{eventend|{{{event|the event}}} has already ended.}}}}}}} <small>({{purge|refresh}})</small></includeonly><noinclude> | | <includeonly><span class="countdowndate">{{#time:F d Y H:i|{{{1}}}}} UTC</span><span class="nocountdown"> This message will be displayed if the timer does not show up (like if you do not have javascript enabled on your browser)</span></includeonly><noinclude> |
|
| |
|
| ----- | | ----- |
| This template creates a countdown timer, and works only in UTC time (the official wiki-time). The correct usage is as follows: | | This template creates a countdown timer, and works only in UTC time (the official wiki-time). The correct usage is as follows: |
|
| |
|
| {{Countdown | | <pre>{{Countdown|[name of month [number pertaining to day] [year] [time of day in UTC]}}</pre> |
| |year = 2012
| |
| |month = 8
| |
| |day = 27
| |
| |hour = 0
| |
| |minute = 0
| |
| |event = TWEWY News
| |
| |duration = 168
| |
| |eventstart = 20/8/2012 has already started
| |
| |eventend = 27/8/2012 has already ended
| |
| }} | |
|
| |
|
| | Therefore, |
| | <pre>{{Countdown|January 1 3000 20:00}}</pre> |
| | |
| | Would create this: |
| | {{Countdown|January 1 3000 20:00}} |
| [[Category:Utility templates]]</noinclude> | | [[Category:Utility templates]]</noinclude> |
Revision as of 15:28, 20 August 2012
This template creates a countdown timer, and works only in UTC time (the official wiki-time). The correct usage is as follows:
{{Countdown|[name of month [number pertaining to day] [year] [time of day in UTC]}}
Therefore,
{{Countdown|January 1 3000 20:00}}
Would create this:
January 01 3000 20:00 UTC This message will be displayed if the timer does not show up (like if you do not have javascript enabled on your browser)