Шаблон:Datetime

Материал из Guild Wars 2 wiki
Перейти к: навигация, поиск

Description[править]

This template uses Widget:Datetime to turn a format and a time value into a representation similar to that of {{UTC time}}.

Usage[править]

{{datetime|<format>}}
{{datetime|<format>|<time>}}
{{datetime|<format>|<time>|ns=<no script text>}}

Parameters[править]

1 (unnamed parameter)
A format string specifing the desiered output. These format strings function similar to those of #time. All supported codes can be found listed in the example on the widgets page. Meaning can be escaped by either puting what is to be taken literaly inside double quotes (") or by prefixing it with a backslash (\). To use a double quote inside of a double quoted section it can be prefixed with a backslash.
2 (unnamed parameter)
Optional. A time value as understood by #time.
If not specified the current time is used.
ns
Optional. The text that should be displayed if scripting is unavailable.
If not specified defaults to the value of unnamed parameter 2 formated using either the format provided via unnamed parameter 1 or "c" if the provided format contains backslash escaped double quotes and #time.

Examples[править]

* {{datetime|"Today is" F d, Y.}}
* {{datetime|"One day ago was" F d, Y.|-1 days}}
* {{datetime|"June 17, 2020 is a" l.|2020-06-17}}
* {{datetime|"The epoch second of \"1234567890\" translates to" c.|@1234567890}}
{{#vardefine: tyriandaystart | {{#time: H:s | @{{#expr: {{#time: U}} - ( {{#time: U}} mod (2*60*60) ) }} }} }}<!--
-->* The current Tyrian day (based on [[Day and night|Tyrian Time]]) started at {{datetime| H:s ("UTC"P) | {{#var: tyriandaystart}} | ns = {{#var: tyriandaystart}} (server time) }}. {{#info: The time shown here might be behind due to wiki page caching.}}
  • The current Tyrian day (based on Tyrian Time) started at .
    The time shown here might be inaccurate/behind due to wiki page caching.