编辑“︁
Template:Time/doc
”︁
跳转到导航
跳转到搜索
页面[[:Module:Message box/mbox.css|Module:Message box/mbox.css]]没有内容。
这是
Time
模板的
文档页面
。
警告:
您没有登录。如果您进行任何编辑,您的IP地址会公开展示。如果您
登录
或
创建账号
,您的编辑会以您的用户名署名,此外还有其他益处。
反垃圾检查。
不要
加入这个!
{{NoteTA |G1 = MediaWiki }} {{Documentation subpage}}<!-- 在本行下編輯模板說明 --> == 概要 == {{lua|Module:time|Module:time/data}} <!-- Please place categories where indicated at the bottom of this page and interwikis at Wikidata (see [[Wikipedia:Wikidata]]) --> 本模板顯示由參數值指定的時區的現在時間,由該時區的[[UTC]] offset計算出來,如果該時區當時正在實施[[夏令時間]],也會相應調整。 '''注意:'''為減輕伺服器負荷,大多數條目頁面顯示該頁面的緩存版本,所以該版本顯示的「現在時間」可能已經過時。您可以點擊{{small|[刷新]}}連結來更新現在時間。 __TOC__ {{Template:Time/doc/parameters}} == 用法 == Typically, all that is needed is: :<code><nowiki>{{</nowiki>time|''<TZ>''}}</code> where <code>''<TZ>''</code>是支持的時區縮寫 ::<code><nowiki>{{time|MST}}</nowiki></code> :::{{time|MST}} To change the rendered format: :<code><nowiki>{{time|MST|df=y}}</nowiki></code> ::{{time|MST|df=y}} :<code><nowiki>{{time|MST|y}}</nowiki></code> ::{{time|MST|y}} :<code><nowiki>{{time|MST|dmy}}</nowiki></code> ::{{time|MST|dmy}} :<code><nowiki>{{time|MST|iso}}</nowiki></code> ::{{time|MST|iso}} ===支持的時區=== This is a list of the currently supported time zone abbreviations: {{div col|colwidth=15em}} *[[Australian Central Standard Time|ACST]] <span style="font-size:75%;">(ACDT)</span> *[[Australian Eastern Standard Time|AEST]] <span style="font-size:75%;">(AEDT)</span> *[[Alaska Standard Time|AKST]] <span style="font-size:75%;">(AKT)</span> *[[Anywhere on Earth|AoE]]{{efn-ua|name=non-standard|Not standard time zones, these are included on a whim of the programmer; AoE is 'Anywhere on Earth', 'IDLE' and 'IDLW' are International Date Line East and West}} *[[Atlantic Standard Time|AST]] <span style="font-size:75%;">(AT) (ADT)</span> *[[Australian Western Standard Time|AWST]] *[[Bangladesh Standard Time|BST]] *[[北京时间|BT]] *[[欧洲中部时间|CET]] <span style="font-size:75%;">(CEST)</span> *[[Chamorro Time Zone|ChST]] *[[北美中部时区|CST]] <span style="font-size:75%;">(CT) (CDT)</span> *[[欧洲东部时间|EET]] <span style="font-size:75%;">(EEST)</span> *[[Eastern Standard Time (North America)|EST]] <span style="font-size:75%;">(ET) (EDT)</span> *[[Greenwich Mean Time|GMT]] *[[Time in the Republic of Ireland|GMT-IE]]{{efn-ua|[[Irish Standard Time]]. The abbreviation, IST, is also used for [[Indian Standard Time]]. Irish Standard Time occurs in the summer. For these reasons, the template uses GMT-IE as the time zone abbreviation for Ireland.}} *[[Time in the United Kingdom|GMT-UK]]{{efn-ua|[[GMT]] does not observe daylight saving time. In the United Kingdom GMT is observed in winter but shifts to [[British Summer Time]]. The abbreviation BST is also used by [[Bangladesh Standard Time]]. To differentiate year-round GMT from GMT as observed in the UK, use GMT-UK.}} *[[Hawaii–Aleutian Time Zone|HAST]] <span style="font-size:75%;">(HADT) (HST) (HDT)</span> *IDLE{{efn-ua|name=non-standard}} *IDLW{{efn-ua|name=non-standard}} *[[Irkutsk Time|IRKT]] *[[Indian Standard Time|IST]] *[[Japan Standard Time|JST]] *[[Krasnoyarsk Time|KRAT]] *[[Moscow Time|MSK]] *[[Mountain Standard Time|MST]] *[[國家標準時間|NST]] *[[New Zealand Standard Time|NZST]] <span style="font-size:75%;">(NZDT)</span> *[[Omsk Time|OMST]] *[[Kamchatka Time|PETT]] *[[Pakistan Standard Time|PKT]] *PMST{{efn-ua|[[Saint-Pierre and Miquelon]] Standard Time}} *[[Pacific Standard Time|PST]] <span style="font-size:75%;">(PT) (PDT)</span> *[[Samara Time|SAMT]] *[[Srednekolymsk Time|SRET]] *[[新加坡標準時間|SST]] *[[Kaliningrad Time|USZ1]] *[[Coordinated Universal Time|UTC]] *[[Vlaspanostok Time|VLAT]] *[[欧洲西部时间|WET]] <span style="font-size:75%;">(WEST)</span> *WGT{{efn-ua|Western Greenland Time}} *[[Western Indonesian Time|WIB]] *[[Eastern Indonesian Time|WIT]] *[[Central Indonesian Time|WITA]] *[[Yakutsk Time|YAKT]] *[[Yekaterinburg Time|YEKT]] {{div col end}} {{notelist-ua}} ===UTC offset=== To display the time at a particular UTC offset, specify the UTC time offset as the time zone: :<code><nowiki>{{time|UTC-07:00}}</nowiki></code> ::{{time|UTC-07:00}} 'UTC', a sign character, two hour digits, a colon, and two minute digits are required. Accepted sign characters are: '+', '-' (hyphen), '±', and '−' (minus). ===Military/nautical time zones=== To display the time at a particular [[military time zones|military]] or [[nautical time zone]],<ref>{{cite web |url=http://astro.ukho.gov.uk/nao/miscellanea/WMTZ/ |title=World Time Zone Map |website=HM Nautical Almanac Office |date=February 2016}}</ref> use the time zone's alpha designation: :<code><nowiki>{{time|M}}</nowiki></code> ::{{time|M}} Some military and nautical time zone designators are extended with an asterisk (*), a dagger (†), or double dagger (‡). When writing this template for designators that are extended with a dagger or double dagger, use '+' and '++' respectively: :<code><nowiki>{{time|M++}}</nowiki></code> ::{{time|M++}} :<code><nowiki>{{time|M+}}</nowiki></code> ::{{time|M+}} ===夏令時間=== Daylight saving time (DST) calculations are automatic for those time zones where it is observed. 有些時區在實施夏令時間時,當中若干地區不跟隨,在這些不使用夏令時間的地區可以使用{{para|dst|no}}: :<code><nowiki>{{time|MST|dst=no}}</nowiki></code> ::{{time|MST|dst=no}} – [[time in Arizona]] :<code><nowiki>{{time|MST}}</nowiki></code> ::{{time|MST}} – but, time on the [[Navajo Nation]] in Arizona The opposite case is not supported. For places like [[Thule Air Base]] in Greenland, which observes US DST rules while WGT observes EU DST rules, a time zone properties table will be needed in Module:Time. See §[[#Adding a new time zone|Adding a new time zone]]. ==錯誤訊息== {{tld|time}}可以產生以下錯誤訊息,包括: :<span style="font-size:100%" class="error"><nowiki>{{time}</nowiki>} – both of |df-cust-a= and |df-cust-p required</span> – when defining a custom format for am (or pm) time, you must also define a custom format for pm (or am) time :<span style="font-size:100%" class="error"><nowiki>{{time}}</nowiki> – error calculating dst timestamps</span> – indicates an internal error because one or more of the following time zone properties is malformed: UTC offset, DST begin or end definition. To resolve this error make sure that the time zone's properties are correct. :<span style="font-size:100%" class="error"><nowiki>{{time}}</nowiki> – incomplete definition for ...</span> – indicates an internal error because one or more of the following time zone properties is missing: DST begin or end definition, DST event time, time zone article. To resolve this error supply the missing properties. :<span style="font-size:100%" class="error"><nowiki>{{time}</nowiki>} – invalid date format <tt><{{var|format}}></tt></span> – value assigned to {{para|df}} is not one of the defined format strings; ss §[[Template:Time#Parameters|Parameters]] :<span style="font-size:100%" class="error"><nowiki>{{time}}</nowiki> – invalid use of ±</span> - 符號±被用於the minute and hour offsets不是00:00的情形 :<span style="font-size:100%" class="error"><nowiki>{{time}</nowiki>} – malformed or incomplete _TEST_TIME_</span> – value assigned to this parameter must either have the format: YYYY-MM-DDThh:mm:ss where all except 'T' are digits, or YYYYMMDDhhmmss :<span style="font-size:100%" class="error"><nowiki>{{time}</nowiki>} – unknown timezone</span> – 填入的time zone positional parameter不是支持的時區縮寫。To resolve this error check the parameter's spelling or add the time zone's properties to the module. 見§[[#加入新時區|加入新時區]]。 ==加入新時區== {{tld|time}}使用[[Module:Time/data]]。這是一個有多個表格的表格,the data structure that specifies the properties of the individual time zones。空白的時區properties table有以下格式: <pre>[''] = { abbr = '', dst_abbr = '', utc_offset = '', df = '', dst_begins = '', dst_ends = '', dst_time = '', dst_e_time = '', article = '' },</pre> 在Module:Time/data加入一個新時區,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> – (必填)一個時區標準時間的縮寫,小寫;this is the value that will be used in the template's time zone pararameter :<code><nowiki>abbr = ''</nowiki></code> – (必填)the abbreviation of a time zone's standard time as it will be rendered by the template :<code><nowiki>dst_abbr = ''</nowiki></code> – 一個時區的夏令時間的縮寫 as it will be rendered by the template :<code><nowiki>utc_offset = ''</nowiki></code> – (必填)the offset in hours and minutes from [[UTC±00:00]];採用以下格式:<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> – 'first', '1st', 'second', '2nd', ... 'fifth', '5th', 或 'last'的其中一個 ::<code><day name></code> – 'Sunday', 'Monday', 'Tuesday', etc.的其中一個;capitalization is not important but otherwise must be spelled correctly;不支持縮寫 ::<code><in|of></code> – 'in' 或 'of'的其中一個 ::<code><month name></code> – 月份名'January', 'February', 'March', etc.的其中一個;capitalization is not important but otherwise must be spelled correctly;不支持縮寫 :<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> – (必填)該時區的條目名;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. ===加入新alias=== You may also want to add an alias of a timezone: <pre>[''] = {tz = ''},</pre> 在Module:Time/data加入新時區,add the appropriate information inside the single quotes. :<code><nowiki>['']</nowiki></code> – (required) the abbreviation of a time zone's alias. This must be lower case. :<code><nowiki>tz = ''</nowiki></code> – (required) the abbreviation of the time zone that's already in the code. This must be lower case The table-of-tables is organized east (plus UTC offsets) then west (minus UTC offset), and by if it's a DST offset or if it's not. ==See also== {{Date and time templates}} ==References== {{reflist}} == 模板编辑说明 == <templatedata> { "params": { "1": { "label": "time zone", "description": "The time zone for the time formatting", "example": "EST", "type": "string", "suggested": true }, "2": { "aliases": [ "df" ], "label": "date format", "description": "The format to render the date and time", "example": "dmy12", "suggested": true }, "dst": { "label": "Daylight savings time", "example": "yes", "type": "string" }, "lang": { "label": "ISO 639 language code", "description": "displays time/date in language specified by ISO 639 language", "type": "string" }, "dateonly": { "description": "If 'yes', suppresses display of the time and only shows the date", "example": "yes", "type": "string" }, "timeonly": { "description": "If 'yes', suppresses display of the date and only shows the time", "example": "yes", "type": "string" }, "hide-tz": { "label": "Hide time zone?", "description": "If 'yes', suppresses time zone abbreviation", "example": "yes", "type": "string" }, "unlink-tz": { "label": "Don't link time zone?", "description": "If 'yes', renders the timezone without linking to its article.", "example": "yes", "type": "string" } } } </templatedata> == 參見 == {{NoteFoot}} <includeonly>{{Sandbox other|| <!-- 本行下加入模板的分類 --> }}</includeonly>
摘要:
请注意,所有对Local Chinese Wikipedia的贡献均可能会被其他贡献者编辑、修改或删除。如果您不希望您的文字作品被随意编辑,请不要在此提交。
您同时也向我们承诺,您提交的内容为您自己所创作,或是复制自公共领域或类似自由来源(详情请见
Project:著作权
)。
未经许可,请勿提交受著作权保护的作品!
取消
编辑帮助
(在新窗口中打开)
导航菜单
个人工具
未登录
讨论
贡献
创建账号
登录
命名空间
模板
讨论
大陆简体
不转换
简体
繁體
大陆简体
香港繁體
澳門繁體
大马简体
新加坡简体
臺灣正體
查看
阅读
编辑
查看历史
更多
搜索
导航
首页
最近更改
随机页面
MediaWiki帮助
工具
链入页面
相关更改
特殊页面
页面信息