Template:Time
跳到导航
跳到搜索
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
and the bool Terraria.Main.time
. Terraria.Main.dayTime
defaults to false, but should always be specified for clarity. The first unnamed parameter always overwrites these two parameters.
$day
Examples
Code | Result |
---|---|
{{time|20:00}} |
下午 8:00 |
{{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 |
分类:
- I18n-ready templates
- Pages with information based on outdated versions of Terraria's source code