Template:Countdown-ymd/doc

Similar to, renders a countdown in years, months, days, hours, minutes, and seconds. It also offer different text handling and supports UTC offsets.

Usage
The minimal form is:

which gives:

Parameters
renders an output that is the difference between the date / time of the article's last refresh to the date / time of a future event.

event date / time
Date / time calculations are made using UTC time provided by WikiMedia's servers. Future event date / times are assumed to begin or end at the UTC time specified in these parameters. utc offset can ease the calculation burden.
 * year: required; four-digit year in which the event takes place
 * month: required if day is specified; one- or two-digit month in which the event takes place; January = 1
 * day: required if hour is specified; one- or two-digit day on which the event takes place; 1–28, 29, 30, or 31 depending on month and year
 * hour: required if minute is specified; one- or two-digit hour at which the event takes place; uses 24-hour clock; 0–23; defaults to midnight (00h)
 * minute: required if second is specified; one- or two-digit minute at which the event takes place; 0–59; defaults to on the hour (hh:00)
 * second: one- or two-digit second at which the event takes place; 0–59; defaults to on the minute (hh:mm:00)
 * duration: time in the form of a number followed by a unit keyword that, when added to the event start date / time, identifies the event end date / time; accepted unit keywords are,  ,  ,   in both singular and plural forms; default is
 * utc offset: hours and minutes difference between UTC and local time zone

presentation
The presentation parameters allow users to customize the template output to suit particular needs.
 * color: sets the color of the date / time digits in the rendered output; default is blue
 * event lead: requires duration; text that precedes the countdown when the countdown refers to the end of the event; default is: 'Event ends in' (without quotes)
 * event tail: requires duration; text that follows the countdown when the countdown refers to the end of the event; terminal punctuation is not supplied
 * expired: text to be displayed when the event date / time has passed; default is 'Event time has passed.' (without quotes)
 * lead: text that precedes the countdown when the countdown refers to the event; defaults: 'Time to event:' (without quotes); when duration is set: 'Event begins in' (without quotes)
 * tail: text that follows the countdown when the countdown refers to the event; terminal punctuation is not supplied

examples
In the following examples, the countdown time to the event is determined from the date / time that this page was last refreshed. That date / time is:
 * (ISO 8601 format)
 * (ISO 8601 format)

countdown
Countdown to tomorrow at 6 pm (18:00:00 UTC) → --T18:00:00 (UTC)

Countdown to at 6pm (18:00:00 UTC) → --T18:00:00 (UTC)
 * – reduces the rendered precision when minute and / or second are not specified
 * – reduces the rendered precision when minute and / or second are not specified

Countdown to
 * – when less than 24 hours until the event, shifts to an hours minutes and seconds  display regardless of the state of minute and second
 * – when less than 24 hours until the event, shifts to an hours minutes and seconds  display regardless of the state of minute and second

duration
An event can be a single point in time as the deadline for filing yearly tax returns, or it can have beginning and end date / times. For this latter, uses duration. For events that are not single point events, the start time is defined by the basic date / time parameters and the end time is the start time plus duration (a number) of duration units. The supported duration units are seconds, minutes, hours, and days. For an event that lasts two weeks we write 14 days.

Default rendering for an event that lasts two hours but hasn't yet begun:

Default rendering for an event in progress that lasts two hours but hasn't yet ended:

utc offset
utc offset eliminates the need to calculate UTC time from local time if the UTC offset of the local time is known. For example, Phoenix, Arizona is in Mountain Time Zone or UTC−07:00. An event that occurs a noon local time in Phoenix occurs at 7pm UTC.

Countdown to local time in Phoenix

The Phoenix example was chosen because Arizona does not observe daylight saving time. For those locations that do, editors must account for the time difference when setting utc offset.

presentation
has several parameters that allow editors to customize the appearance of the rendered template.
 * color: values can be RGB hex codes or any of the CSS colors
 * – #C9E72A
 * – DarkOliveGreen
 * lead and tail provide text that precedes and follows the countdown while the countdown is in progress. If lead text is not desired, none will suppress the default lead text.
 * event lead and event tail provide text that precedes and follows the countdown while an event is in progress. These parameters require duration without which they are ignored. If leading event text is not desired, none will suppress the default event lead text.
 * expired provides text to take the place of the countdown once the countdown is completed. If text noting the completion of the countdown is not desired, none will suppress the default completion text.
 * event lead and event tail provide text that precedes and follows the countdown while an event is in progress. These parameters require duration without which they are ignored. If leading event text is not desired, none will suppress the default event lead text.
 * expired provides text to take the place of the countdown once the countdown is completed. If text noting the completion of the countdown is not desired, none will suppress the default completion text.
 * event lead and event tail provide text that precedes and follows the countdown while an event is in progress. These parameters require duration without which they are ignored. If leading event text is not desired, none will suppress the default event lead text.
 * expired provides text to take the place of the countdown once the countdown is completed. If text noting the completion of the countdown is not desired, none will suppress the default completion text.
 * expired provides text to take the place of the countdown once the countdown is completed. If text noting the completion of the countdown is not desired, none will suppress the default completion text.
 * expired provides text to take the place of the countdown once the countdown is completed. If text noting the completion of the countdown is not desired, none will suppress the default completion text.
 * expired provides text to take the place of the countdown once the countdown is completed. If text noting the completion of the countdown is not desired, none will suppress the default completion text.
 * expired provides text to take the place of the countdown once the countdown is completed. If text noting the completion of the countdown is not desired, none will suppress the default completion text.
 * expired provides text to take the place of the countdown once the countdown is completed. If text noting the completion of the countdown is not desired, none will suppress the default completion text.
 * expired provides text to take the place of the countdown once the countdown is completed. If text noting the completion of the countdown is not desired, none will suppress the default completion text.
 * expired provides text to take the place of the countdown once the countdown is completed. If text noting the completion of the countdown is not desired, none will suppress the default completion text.

error messages
emits only one error message:
 * Error: invalid date and/or time

For dates, the valid combinations of parameters are:
 * year or
 * year month or
 * year month day

all other date combinations are erroneous. If time is included, all of the date parameters are required and one of these combinations of time parameters:
 * hour or
 * hour minute or
 * hour minute second

all other time combinations are erroneous.

Countdown to 30 February