Template:Countdown

{{#ifeq:{{#expr: {{#time:U}} < {{#if:{{{timecode|}}}|{{{timecode|}}}|{{#time:U|{{{year}}}-{{{month|1}}}-{{{day|1}}} {{{hour|00}}}:{{{minute|00}}}:{{{second|00}}}}}}}}}|1|Only {{#ifeq:{{#expr: {{#time:U}} < {{#if:{{{timecode|}}}|{{{timecode|}}}|{{#time:U|{{{year}}}-{{{month|1}}}-{{{day|1}}} {{{hour|00}}}:{{{minute|00}}}:{{{second|00}}}}}}} - 86399}}|1|{{#expr:( ( ( {{#if:{{{timecode|}}}|{{{timecode|}}}|{{#time:U|{{{year}}}-{{{month|1}}}-{{{day|1}}} {{{hour|00}}}:{{{minute|00}}}:{{{second|00}}}}}}} - {{#time:U}}) / 86400 ) -0.5) round 0}}  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|{{#expr: {{#if:{{{timecode|}}}|{{{timecode|}}}|{{#time:U|{{{year}}}-{{{month|1}}}-{{{day|1}}} {{{hour|00}}}:{{{minute|00}}}:{{{second|00}}}}}}} - {{#time:U}}}}  seconds |{{#expr: ( ( ( {{#if:{{{timecode|}}}|{{{timecode|}}}|{{#time:U|{{{year}}}-{{{month|1}}}-{{{day|1}}} {{{hour|00}}}:{{{minute|00}}}:{{{second|00}}}}}}} - {{#time:U}} ) / 60 ) - 0.5 ) round 0 }}  minutes}} |{{#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}}  hours}} left until {{{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.}}}}}}}

Usage
Editors can use this template as a countdown clock for a lot of different events. The following can show you how to use this template.

Simple Countdown Clock
This type of countdown clock is suitable for events with no duration.

If you type in the above, something like the following will appear.

Advanced Countdown Clock
This type of countdown clock is suitable for events with a duration.

If you type in the above, something like the following will appear.