Difference between revisions of "Template:Datetime"
Jump to navigation
Jump to search
FireonLive (talk | contribs) (a quick stab at making the datetime template as discussed in -bs, someone can spruce it up/fix it before we start using it) |
(Default to UTC when no time zone is specified) |
||
(5 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
{{#formatdate:{{{1}}}}} {{{2}}} (UTC{{{ | <includeonly>{{#formatdate:{{{1}}}}}{{#if:{{{2|}}}|<nowiki/> {{{2}}} {{#if:{{{3|}}}|{{{3}}} (UTC{{{4}}})|UTC}}|}}</includeonly><noinclude> | ||
== Help == | |||
Takes a date and time and formats it consistently across the wiki, using the user's preferences for the date portion. | |||
Usage: | |||
* Date & Time: <code><nowiki>{{datetime|ISO 8601 date|24h time|timezone|+/- from UTC}}</nowiki></code> or <code><nowiki>{{datetime|ISO 8601 date|24h time in UTC}}</nowiki></code> | |||
* Date: <code><nowiki>{{datetime|ISO 8601 date}}</nowiki></code> | |||
Example: | |||
* Date & Time: | |||
** <code><nowiki>{{datetime|2023-08-28|22:00|CEST|+2}}</nowiki></code> turns in to <code>{{datetime|2023-08-28|22:00|CEST|+2}}</code> | |||
** <code><nowiki>{{datetime|2023-10-01|13:37}}</nowiki></code> turns into <code>{{datetime|2023-10-01|13:37}}</code> | |||
* Date: <code><nowiki>{{datetime|2023-08-28}}</nowiki></code> turns in to <code>{{datetime|2023-08-28}}</code> | |||
[[Category:Templates]] | |||
</noinclude> |
Revision as of 23:26, 19 October 2023
Help
Takes a date and time and formats it consistently across the wiki, using the user's preferences for the date portion.
Usage:
- Date & Time:
{{datetime|ISO 8601 date|24h time|timezone|+/- from UTC}}
or{{datetime|ISO 8601 date|24h time in UTC}}
- Date:
{{datetime|ISO 8601 date}}
Example:
- Date & Time:
{{datetime|2023-08-28|22:00|CEST|+2}}
turns in to2023-08-28 22:00 CEST (UTC+2)
{{datetime|2023-10-01|13:37}}
turns into2023-10-01 13:37 UTC
- Date:
{{datetime|2023-08-28}}
turns in to2023-08-28