Template:TimeSwitch/doc

TimeSwitch allows to display different text based on the current date and time. This is most useful for events and limited time items, where it is necessary to switch the tense when an event is over or an item is no longer available. This is also useful when talking about unreleased content that will become available at a known point in the future.

Usage
The template can be used in the following ways:
 * Text1
 * Text1

The invocations can be read as following: Dispay  until   is reached. As soon as that is the case, display  until   is reached. An unlimited amount of text and date parameters is supported. The last parameter can both be a date and a text.

If the last given text is the one that gets displayed, the page will automatically be added to Category:Pages with unnneeded TimeSwitches. Unnecessary template calls can easily be spotted and removed this way.

Due to the fact that there are several layers of caches, changes will not show immediately on pages. It can take up to 24 hours for the content to be regenerated. Therefore this template should not be used if exact timing is required.

(unnamed parameters 1, 3, 5,...)
These parameters can just be any text. It will be displayed on the page without modification, if it is the text for the current date.

If this text contains an equal-sign ("="), the default template call will no longer work. In that case the index of the affected parameter must be passed explicitly:

Which will produce the output "1+1=2". Indexing is one-based, that is the first parameter has the index one.

(unnamed parameters 2, 4, 6,...)
The date and time to compare to. As long as it is not reached, the text left to it will be displayed. As soon as it is reached, the next date will be evaluated. If there is no further date, the text right to it will be displayed, if there is no text right to it, nothing will be displayed.

Dates can be passed in a variety of formats. Here are a few examples:

A complete list of supported formats can be found in the underlying datetime-framework's documentation. However, as noted above pages will not update immediately. One should not bother to specify second or minutes. Hours however can be useful in some cases.