Difference between revisions of "Template:Datetime/doc"

From blackwiki
Jump to navigation Jump to search
imported>BrandonXLF
imported>MarnetteD
(rmv deprecated field)
 
(6 intermediate revisions by 4 users not shown)
Line 1: Line 1:
'''This template is for showing the local time of settlements on settlement articles.''' ''Please keep it this way and don't change the use of this template.''
+
{{Documentation subpage}}
 +
<!-- PLEASE ADD CATEGORIES AND INTERWIKIS AT THE BOTTOM OF THIS PAGE -->
  
''For a template that displays the current date in UTC as normal text without a picture see [[Template:Time]]''
+
== Usage ==
 +
This template is intended to be used for time stamping. It provides the date in the form ''' ''MINUTE:HOUR'', ''DAY MONTH YEAR'' (UTC)''' or '''<nowiki>'{{#time:H:i, d F Y (e)}}'</nowiki>'''. Use is usually best preceded by ''''subst:''''.
  
{{lua|Module:time}}
+
The output is equivalent to using <code><nowiki>{{#time:H:i, d F Y (e)}}</nowiki></code> via the time [[Help:Magic words#Formatting|parser function]].
 +
== See also ==
 +
{{Date and time templates}}
  
==Useage==
+
<includeonly>{{Sandbox other||
<code><nowiki>{{timedate|time zone|dst=yes or no}}</nowiki></code>
+
<!-- CATEGORIES AND INTERWIKIS HERE, THANKS -->
*repalce 'time zone' with the time zone abberation [[documentation|template:time/doc#Supported_time_zones]]
+
[[Category:Time, date and calendar templates|Datetime]]
*Pick yes or no depending on if daylight saving times should apply.
 
  
==Example==
+
}}</includeonly>
<code><nowiki>{{timedate|EST|dst=yes}}</nowiki></code>
 
<br>
 
{{timedate|EST|dst=yes}}
 
 
 
Note: If no time zone is put and time zone is removed then will use [[UTC]] time.
 
 
 
==Adding a new time zone==
 
{{tld|time}} uses [[Module:Time]].  In that module, is a table of tables, the data structure that specifies the properties of the individual time zones.  A blank time zone properties table has this form:
 
<pre>[''] = {
 
abbr = '',
 
dst_abbr = '',
 
utc_offset = '',
 
df = '',
 
dst_begins = '',
 
dst_ends = '',
 
dst_time = '',
 
dst_e_time = '',
 
article = ''
 
},</pre>
 
 
 
To add a new time zone to Module:Time, add the appropriate information inside the single quotes.  If a property does not apply, leave the quotes empty.  The rules for each property are:
 
:<code><nowiki>['']</nowiki></code> – (required) the abbreviation of a time zone's standard time; must be lower case; this is the value that will be used in the template's time zone pararameter
 
:<code><nowiki>abbr = ''</nowiki></code> – (required) the abbreviation of a time zone's standard time as it will be rendered by the template
 
:<code><nowiki>dst_abbr = ''</nowiki></code> – the abbreviation of a time zone's daylight saving or summer time as it will be rendered by the template
 
:<code><nowiki>utc_offset = ''</nowiki></code> – (required) the offset in hours and minutes from [[UTC±00:00]]; has the form: <code><nowiki>utc_offset = '<sign>hh:mm'</nowiki></code> where <code><sign></code> may be <code>+</code> (optional) or <code>-</code> (required for time zones west of the 0 meridian)
 
:<code><nowiki>df = ''</nowiki></code> – one of three keywords <code>dmy</code>, <code>mdy</code>, or <code>iso</code> used to specify date format typically used in the time zone; can be overridden with {{para|df}} template parameter
 
:<code><nowiki>dst_begins = ''</nowiki></code> – a four word sentence in the form <code><ordinal></code> <code><day name></code> <code><in|of></code> <code><month name></code> where:
 
::<code><ordinal></code> – any of the words 'first', '1st', 'second', '2nd', ... 'fifth', '5th', or 'last'
 
::<code><day name></code> – any of the day names 'Sunday', 'Monday', 'Tuesday', etc.; capitalization is not important but otherwise must be spelled correctly; abbreviations not supported
 
::<code><in|of></code> – either of the words 'in' or 'of'
 
::<code><month name></code> – any of the month names 'January', 'February', 'March', etc.; capitalization is not important but otherwise must be spelled correctly; abbreviations not supported
 
:<code><nowiki>dst_ends = ''</nowiki></code> – (required if <code>dst_begins</code> is specified) same as <code>dst_begins</code>
 
:<code><nowiki>dst_time = ''</nowiki></code> – (required if <code>dst_begins</code> is specified) the time that daylight saving time begins; usually local time; when DST begins at a specified time UTC ([[European Summer Time]] for example) use:  <code>dst_time = 'hh:mm UTC'</code>; four digits and the colon are required
 
:<code><nowiki>dst_e_time = ''</nowiki></code> – the time that daylight saving time ends if different from the time it begins; usually local daylight saving time ; when DST ends at a specified time UTC use:  <code>dst_e_time = 'hh:mm UTC'</code>; four digits and the colon are required
 
:<code><nowiki>article = ''</nowiki></code> – (required) the title of a Wikipedia article that is appropriate to the timezone; do not include wikimarkup
 
 
 
The table-of-tables is organized east (plus UTC offsets) then west (minus UTC offset), by offset hours, and then alphabetically by time zone positional parameter name.
 

Latest revision as of 02:52, 17 May 2020

Usage

This template is intended to be used for time stamping. It provides the date in the form MINUTE:HOUR, DAY MONTH YEAR (UTC) or '{{#time:H:i, d F Y (e)}}'. Use is usually best preceded by 'subst:'.

The output is equivalent to using {{#time:H:i, d F Y (e)}} via the time parser function.

See also

[edit] all subsections that follow:


Multiple units of time

Type Adjustable Current Last Next
Date and time {{time}} {{Currentdate}} (MDY)
{{Plain now}} (DMY)
{{Now}} (DMY in a complete sentence)
{{Simple now}}
Date only {{Dateonly}}
{{Datedow}}
(Has the day of the week)
{{Date}} (Chose format)
{{DATE}} (prefixed by date=)
{{TODAY}} (DMY)
{{Yesterday}}
{{Day-1}}
{{Tomorrow}}
{{Day+1}}
Time only {{Timeonly}} {{CURRENTTIME}} (12 h format)
{{CURRENTTIME24}} (24 h format)
Banners {{Right now}}
(Blue with time and number of Wikipedia articles)
Timestamp {{Timestamp}}
(Format YYYYMMDDhhmmss)

Single units of time

Unit of time Adjustable Current Last Next
SECOND {{CURRENTSECOND}}
MINUTE {{CURRENTMINUTE}}
HOUR {{CURRENTHOUR}} {{Hour-1}} {{Hour+1}}
WEEK {{CURRENTWEEK}}
{{CURRENTWEEKOFMONTH}}
Day of Week {{Dow}} {{CURRENTDAYNAME}}
{{CURRENTWEEKDAYABBREV}}
{{CURRENTWEEKDAY}}
{{LASTWEEKDAYNAME}}
{{LASTWEEKDAYABBREV}}
{{NEXTWEEKDAYNAME}}
{{NEXTWEEKDAYABBREV}}
MONTH {{MONTHNAME}}
{{MONTHABBREV}}
{{MONTHNUMBER}}
{{MONTH}} (zero padded)
{{CURRENTMONTHNAME}}
{{CURRENTMONTHABBREV}}
{{CURRENTMONTH1}}
{{CURRENTMONTHDAYS}}
{{LASTMONTH}}
(Can make not zero-padded)
{{LASTMONTHNAME}}
{{LASTMONTHABBR}}
{{NEXTMONTH}}
(Can make not zero-padded)
{{NEXTMONTHNAME}}
{{NEXTMONTHABBR}}
Day of Month {{CURRENTDAY}}
{{CURRENTDAY2}} (zero padded)
YEAR {{CURRENTYEARCC}}
{{CURRENTYEARYY}}
{{CURRENTISOYEAR}}
{{CURRENTYEAR}}
{{LASTYEAR}} {{NEXTYEAR}}
Day of Year {{CURRENTDAYOFYEAR}}
DECADE {{DECADE}} {{CURRENTDECADE}} {{LASTDECADE}} {{NEXTDECADE}}
CENTURY {{CENTURY}} {{CURRENTCENTURY}} {{LASTCENTURY}} {{NEXTCENTURY}}
MILLENNIUM {{MILLENNIUM}} {{Currentmillennium}}

Date and time templates made for substitution:

Month:
{{Lmonth}} produces Dec
{{Nmonth}} produces Feb
{{LastMonth}} produces December 2025
{{NextMonth}} produces February 2026


Individual templates

Categories of templates