编辑“︁
Template:Date/doc
”︁(章节)
跳转到导航
跳转到搜索
这是
Date
模板的
文档页面
。
警告:
您没有登录。如果您进行任何编辑,您的IP地址会公开展示。如果您
登录
或
创建账号
,您的编辑会以您的用户名署名,此外还有其他益处。
反垃圾检查。
不要
加入这个!
===用法=== 本模版使用两个参数,两者都是可选的: <!-- This template takes up to two parameters, both of which are optional: --> <code><nowiki>{{</nowiki>date|</code><span style="color:gray;">''<要格式化的日期>''</span>|<span style="color:gray;">''<日期格式化的方式>''</span><code><nowiki>}}</nowiki></code> * '''''<要格式化的日期>''''' :本参数为可选的 *:如果没填入具体日期,则本模版自动填上现在时间<br />例如,{{nowrap|<tt><nowiki>{{date}}</nowiki></tt>}} produces {{date}}。 *:如果填入了具体日期,但其格式不能被本模版识别出的话,本模版会显示''as is''。大多数日期格式都能被识别出,包括所有在维基百科通常使用的格式。其他日期数字的变体也被识别,包括缩写或小写的月份名称,'st'、'nd'、'rd'、'th'缩写,忽略空格,缺逗号,等。 <!-- *:If a date is provided, but is not recognized as one, the text is just returned ''as is''. Most dates will however be recognized as such, including all the formats typically used on Wikipedia. Numerous variations thereof are also supported, including abbreviated or lower case month names; genitive 'st', 'nd', 'rd', 'th'; extraneous white space; missing comma etc. --> *:'''注意''': *:*一些数据不是真正的日期数据,但使用该模版也会被识别为日期数据。请看[[#注意事项|注意事项]] <!-- *:* Some dates are converted even if they are not real dates, and some dates are not converted even though they are real dates. See [[#Known issues|known issues]] below. --> *:*只支持{{date|January 1, 1000}}到{{date|December 31, 9999}}的时间段。两位数的日期会产生意想不到的结果。在1000~9999范围的的数据将被视为第二参数为"none"。 <!-- *:* Only dates within the range {{date|January 1, 1000}} and {{date|December 31, 9999}} are supported. Dates with two digit dates will have unexpected results. Other dates outside the range 1000–9999 will be treated as if the second parameter were "none". --> * '''''<日期格式化的方式>''''': 本参数用于控制日期的输出格式。 *:如无指明本参数,本模版默认格式为'd month yyyy' <!-- *: If no style is specified, the template emits a date in 'd month yyyy' format, as it appears (for example) on discussion pages. --> *:能被第二参数识别的属性值如下: <!-- *:Recognized values for the second parameter are: --> *:* '''<tt style="padding-right:2.5em;">none</tt>''' <!-- applies no formatting whatsoever -->没适用的格式化 *:* '''<tt style="padding-right:3em;">dmy</tt>''' 输出格式为 ''d mmmm yyyy'' (例如:''{{date||dmy}}''),这是默认格式。 *:* '''<tt style="padding-right:3em;">mdy</tt>''' 输出格式为 ''mmmm d, yyyy'' (例如:''{{date||mdy}}'') *:* '''<tt style="padding-right:3em;">ymd</tt>''' 输出格式为 ''yyyy mmmm dd'' (例如:''{{date||ymd}}'') *:* '''<tt style="padding-right:3em;">iso</tt>''' 输出符合 [[:en:WP:ISO 8601|ISO 8601]] 的格式 ''yyyy-mm-dd'' (例如:''{{date||iso}}'') *:'''注意''': *:*虽然这是能被MediaWiki的日期自动格式化系统所支持的四种格式,但只有<code>dmy</code>/<code>ldmy</code>和<code>mdy</code>/<code>lmdy</code>与英文维基[[:en:MOS:DATE#Full_date_formatting|格式手册]]。使用<code>iso</code>/<code>liso</code>这种[[:en:WP:ISO 8601|ISO 8601]]标准格式在''within article prose''在格式书册中是被不允许的,这种格式应该只在表格中使用。 <!-- *:* Although these are the four formats supported by MediaWiki's date autoformatting mechanism, only <code>dmy</code>/<code>ldmy</code> and <code>mdy</code>/<code>lmdy</code> are in accordance with the English language Wikipedia's [[MOS:DATE#Full_date_formatting|Manual of Style]]. The use of <code>iso</code>/<code>liso</code> ([[WP:ISO 8601|ISO 8601]]) format ''within article prose'' is expressly discouraged by the Manual of Style; this format should only be used in tables or lists. --> *:*在每一种情况下,MediaWiki的自动日期格式化系统都能输出准确的时间格式,<div>但是,即使日期为链接,也'''不会'''被MediaWiki自动日期格式化系统修改的,这意味着允许日期能有一致的输出格式,不管其是否被链接。</div> <!-- *:* In each case, the result is exactly the same as what would be emitted by MediaWiki's date autoformatting mechanism.<div>However, dates are '''''not''''' manipulated by MediaWiki's date autoformatting mechanism even when linked. This permits dates to have a consistent appearance regardless of whether they are linked or not.</div> -->
摘要:
请注意,所有对Local Chinese Wikipedia的贡献均可能会被其他贡献者编辑、修改或删除。如果您不希望您的文字作品被随意编辑,请不要在此提交。
您同时也向我们承诺,您提交的内容为您自己所创作,或是复制自公共领域或类似自由来源(详情请见
Project:著作权
)。
未经许可,请勿提交受著作权保护的作品!
取消
编辑帮助
(在新窗口中打开)
导航菜单
个人工具
未登录
讨论
贡献
创建账号
登录
命名空间
模板
讨论
大陆简体
不转换
简体
繁體
大陆简体
香港繁體
澳門繁體
大马简体
新加坡简体
臺灣正體
查看
阅读
编辑
查看历史
更多
搜索
导航
首页
最近更改
随机页面
MediaWiki帮助
工具
链入页面
相关更改
特殊页面
页面信息