Widget:Datetime

From Guild Wars 2 Wiki
Jump to navigationJump to search

Description

This widget formats a time supplied to it in a way similar to {{UTC time}} while functioning in a way similar to #time in that it accepts a format and a time value.

Parameters

format
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 below. 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.
time
A timestamp specifing the time that should be used to format with expressed as epoch seconds.
ns
A text to be displayed if no scripting is available.
namespace
An identifier to be included in the ID assigned to target elements to distinguish them even in contexts which would otherwise cause ID colissions.

Notes

  • This widget should be used via {{datetime}} so that its usage can be tracked.
  • Incompatibilities of formats in terms of exchangable use with #time:
    • #time does not support the use of backslashes to escape double quotes within double quoted sections.

Example

{{datetime|1=
"Y = 4 digit Year": ................... Y
"y = 2 digit year": ................... y
"m = Month (prefixed)": ............... m
"n = Month": .......................... n
"F = Month (text)": ................... F
"M = Month (short text)": ............. M
"d = Day (prefixed)": ................. d
"j = Day": ............................ j
"N = Day of Week (1-7 (Mon-Sun))": .... N
"w = Day of Week (0-6 (Sun-Sat))": .... w
"l = Day of Week (text)": ............. l
"D = Day of Week (short text)": ....... D
"a = am/pm": .......................... a
"A = AM/PM": .......................... A
"h = Hour (12h, prefixed)": ........... h
"g = Hour (12h)": ..................... g
"H = Hour (24h, prefixed)": ........... H
"G = Hour (24h)": ..................... G
"i = Minutes (prefixed)": ............. i
"s = Seconds (prefixed)": ............. s
"U = Epoch second": ................... U
"P = Time Zone offset": ............... P
"O = Time Zone offset (without colon)": O
"Z = Time Zone offset (seconds)": ..... Z
"c = ISO formated": ................... c
}}

2024-11-21T14:54:10+00:00