Template:Time

From Terraria Wiki
Jump to navigation Jump to search
This template is i18n-ready, which means it is easy to localize for different languages. Please see I18n & l10n for templates to learn more.
See Template:Time/l10n for the localization of this template.
Template-info.svg Documentation The documentation below is transcluded from Template:Time/doc. (edit | history)

This template is used to include a time in a standardized, localized format, exactly as it is displayed by watches and their upgrades in-game. It also supports ticks as input and will convert them according to Terraria's source code.

Usage

{{ time | <time to display> | ticks = <time in ticks> | day = y/yes/n/no }}

First unnamed parameter

Time to display. This can be in any format recognized by the {{#time:}} parser function (i.e. any valid PHP strtotime() input), such as 19:45:33 or noon.

ticks and day

Time representation as in the source code, i.e. the float Terraria.Main.time and the bool Terraria.Main.dayTime. $day defaults to false, but should always be specified for clarity. The first unnamed parameter always overwrites these two parameters.

Examples

Code Result
{{time|20:00}} 8:00 PM
{{lang/set|es}}
{{time|20:00}}
Set language to Spanish
8:00 P. M.
{{lang/set|fr}}
{{time|20:00}}
Set language to French
20h00
{{lang/set|pl}}
{{time|20:00}}
Set language to Polish
8:00 Po południu
{{lang/set|ru}}
{{time|20:00}}
Set language to Russian
20:00
{{lang/set|zh}}
{{time|20:00}}
Set language to Chinese
下午 8:00
{{time|ticks=48972|day=y}} 6:06 PM
{{time|ticks=6485.8023|day=n}} 9:18 PM