Difference between revisions of "Template:Datetime/doc"
imported>BrandonXLF |
imported>BrandonXLF |
||
| Line 11: | Line 11: | ||
<br> | <br> | ||
{{timedate|EST|dst=yes}} | {{timedate|EST|dst=yes}} | ||
| + | |||
| + | ==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. | ||
Revision as of 22:50, 16 December 2017
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.
Useage
{{timedate|time zone|dst=yes or no}}
- repalce 'time zone' with the time zone abberation template:time/doc#Supported_time_zones
- Pick yes or no depending on if daylight saving times should apply.
Example
{{timedate|EST|dst=yes}}
Template:Timedate
Adding a new time zone
{{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:
[''] = {
abbr = '',
dst_abbr = '',
utc_offset = '',
df = '',
dst_begins = '',
dst_ends = '',
dst_time = '',
dst_e_time = '',
article = ''
},
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:
['']– (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 pararameterabbr = ''– (required) the abbreviation of a time zone's standard time as it will be rendered by the templatedst_abbr = ''– the abbreviation of a time zone's daylight saving or summer time as it will be rendered by the templateutc_offset = ''– (required) the offset in hours and minutes from UTC±00:00; has the form:utc_offset = '<sign>hh:mm'where<sign>may be+(optional) or-(required for time zones west of the 0 meridian)df = ''– one of three keywordsdmy,mdy, orisoused to specify date format typically used in the time zone; can be overridden with|df=template parameterdst_begins = ''– a four word sentence in the form<ordinal><day name><in|of><month name>where:<ordinal>– any of the words 'first', '1st', 'second', '2nd', ... 'fifth', '5th', or 'last'<day name>– any of the day names 'Sunday', 'Monday', 'Tuesday', etc.; capitalization is not important but otherwise must be spelled correctly; abbreviations not supported<in|of>– either of the words 'in' or 'of'<month name>– any of the month names 'January', 'February', 'March', etc.; capitalization is not important but otherwise must be spelled correctly; abbreviations not supported
dst_ends = ''– (required ifdst_beginsis specified) same asdst_beginsdst_time = ''– (required ifdst_beginsis 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:dst_time = 'hh:mm UTC'; four digits and the colon are requireddst_e_time = ''– 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:dst_e_time = 'hh:mm UTC'; four digits and the colon are requiredarticle = ''– (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.