跳转到内容
主菜单
主菜单
移至侧栏
隐藏
导航
首页
最近更改
随机页面
MediaWiki帮助
代码酷
搜索
搜索
中文(中国大陆)
外观
创建账号
登录
个人工具
创建账号
登录
未登录编辑者的页面
了解详情
贡献
讨论
编辑“︁
模板:Start date and age/doc
”︁
模板
讨论
大陆简体
阅读
编辑源代码
查看历史
工具
工具
移至侧栏
隐藏
操作
阅读
编辑源代码
查看历史
常规
链入页面
相关更改
特殊页面
页面信息
外观
移至侧栏
隐藏
您的更改会在有权核准的用户核准后向读者展示。
警告:
您没有登录。如果您进行任何编辑,您的IP地址会公开展示。如果您
登录
或
创建账号
,您的编辑会以您的用户名署名,此外还有其他益处。
反垃圾检查。
不要
加入这个!
{{Documentation subpage}} <!-- EDIT TEMPLATE DOCUMENTATION BELOW THIS LINE --> {{High-use}} {{COinS safe|n}} {{Template shortcut|sda}} {{Lua|Module:Check for unknown parameters|Module:Date time}} {{tlb|Start date and age}} displays the date that an event or entity started or was created. It also includes a duplicate, machine-readable date in the [[ISO 8601]] format (which is hidden by [[CSS]]), for use inside other templates which emit [[microformat]]s. The hidden date degrades gracefully when CSS is not available. == Usage == * {{tlx|Start date and age|{{var|YYYY}}|{{var|MM}}|{{var|DD}}}} (year, month, and day) * {{tlx|Start date and age|{{var|YYYY}}|{{var|MM}}|{{var|DD}}|df{{=}}yes}} * {{tlx|Start date and age|{{var|YYYY}}|{{var|MM}}|{{var|DD}}|df{{=}}yes|p{{=}}yes|br{{=}}yes}} == Parameters == {| class="wikitable" ! Parameter ! Status ! Description |- | {{para|1}} | required | A four-digit number indicating the year. |- | {{para|2}} | optional | A number between 1 and 12 indicating the month (leading zeros in the number are ignored). |- | {{para|3}} | optional | A number between 1 and 31 indicating the day of the month (leading zeros in the number are ignored). |- | {{para|df}} | optional | When set to {{para|df|yes}} or {{para|df|y}} displays the day before the month (e.g. "7 November 2004" instead of the default "November 7, 2004"). |- | {{para|p}}<br/> {{para|paren}} | optional | When set to {{para|p|yes}} or {{para|p|y}} the age will be displayed within parentheses. When this parameter is not included, the date and age are separated by a semicolon and a breaking space. |- | {{para|br}} | optional | When set to {{para|br|yes}} or {{para|br|y}} a line break will be inserted between the date and the age. When this parameter is not included, a breaking space will be inserted between the date and the age. This does not change the separating characters between the date and age which are either a semicolon (default setting) or parentheses (if {{para|p|yes}}). |} == Examples == === Default separator: semicolon === {| class="wikitable" style="width:100%;" ! style="width:60%;" | Syntax ! style="width:40%;" | Result |- |colspan="2" style="background-color:#DDD" | '''Full date (year, month, day)''' |- | {{tlx|Start date and age|2010|01|02}} | {{Start date and age|2010|01|02}} |- | {{tlx|Start date and age|2010|1|2|df{{=}}yes}} | {{Start date and age|2010|1|2|df=yes}} |- | {{tlx|Start date and age|2008|01|9|df{{=}}y}} | {{Start date and age|2008|01|9|df=y}} |- | 100 days ago:<br />{{tlx|Start date and age|{{#time:Y|now-100 days}}|{{#time:n|now-100 days}}|{{#time:j|now-100 days}}}} | {{Start date and age|{{#time:Y|now-100 days}}|{{#time:n|now-100 days}}|{{#time:j|now-100 days}}}} |- | Yesterday:<br />{{tlx|Start date and age|{{#time:Y|now-1 days}}|{{#time:n|now-1 days}}|{{#time:j|now-1 days}}}} | {{Start date and age|{{#time:Y|now-1 days}}|{{#time:n|now-1 days}}|{{#time:j|now-1 days}}}} |- | Today:<br />{{tlx|Start date and age|{{#time:Y|now}}|{{#time:n|now}}|{{#time:j|now}}}} | {{Start date and age|{{#time:Y|now}}|{{#time:n|now}}|{{#time:j|now}}}} |- |colspan="2" style="background-color:#DDD" | '''Year and month''' |- | {{tlx|Start date and age|2001|9}} | {{Start date and age|2001|9}} |- | {{tlx|Start date and age|2002|09}} | {{Start date and age|2002|09}} |- |colspan="2" style="background-color:#DDD" | '''Year only''' |- | {{tlx|Start date and age|2005}} | {{Start date and age|2005}} |} === Optional separator: parentheses === {| class="wikitable" style="width:100%;" ! style="width:60%;" | Syntax ! style="width:40%;" | Result |- |colspan="2" style="background-color:#DDD" | '''Full date (year, month, day)''' |- | {{tlx|Start date and age|2003|02|15|p{{=}}yes}} | {{Start date and age|2003|02|15|p=yes}} |- | {{tlx|Start date and age|2003|02|15|df{{=}}y|p{{=}}y}} | {{Start date and age|2003|02|15|df=y|p=yes}} |- |colspan="2" style="background-color:#DDD" | '''Year and month''' |- | {{tlx|Start date and age|2003|02|p{{=}}y}} | {{Start date and age|2003|02|p=y}} |- |colspan="2" style="background-color:#DDD" | '''Year only''' |- | {{tlx|Start date and age|2003|paren{{=}}yes}} | {{Start date and age|2003|paren=yes}} |} === Line break with semicolon === {| class="wikitable" style="width:100%;" ! style="width:60%;" | Syntax ! style="width:40%;" | Result |- |colspan="2" style="background-color:#DDD" | '''Full date (year, month, day)''' |- | {{tlx|Start date and age|2003|02|15|br{{=}}yes}} | {{Start date and age|2003|02|15|br=yes}} |- | {{tlx|Start date and age|2003|02|15|df{{=}}y|br{{=}}y}} | {{Start date and age|2003|02|15|df=y|br=y}} |- |colspan="2" style="background-color:#DDD" | '''Year and month''' |- | {{tlx|Start date and age|2003|02|br{{=}}y}} | {{Start date and age|2003|02|br=y}} |- |colspan="2" style="background-color:#DDD" | '''Year only''' |- | {{tlx|Start date and age|2003|br{{=}}yes}} | {{Start date and age|2003|br=yes}} |} === Line break with parentheses === {| class="wikitable" style="width:100%;" ! style="width:60%;" | Syntax ! style="width:40%;" | Result |- |colspan="2" style="background-color:#DDD" | '''Full date (year, month, day)''' |- | {{tlx|Start date and age|2003|02|15|p{{=}}yes|br{{=}}yes}} | {{Start date and age|2003|02|15|p=yes|br=yes}} |- | {{tlx|Start date and age|2003|02|15|df{{=}}y|p{{=}}y|br{{=}}y}} | {{Start date and age|2003|02|15|df=y|p=y|br=y}} |- |colspan="2" style="background-color:#DDD" | '''Year and month''' |- | {{tlx|Start date and age|2003|02|p{{=}}y|br{{=}}y}} | {{Start date and age|2003|02|p=y|br=y}} |- |colspan="2" style="background-color:#DDD" | '''Year only''' |- | {{tlx|Start date and age|2003|paren{{=}}yes|br{{=}}yes}} | {{Start date and age|2003|paren=yes|br=yes}} |} ==TemplateData == {{collapse top|[[Wikipedia:TemplateData|TemplateData]] documentation used by [[Wikipedia:VisualEditor|VisualEditor]] and other tools}} {{TemplateData header|noheader=1}} <templatedata> { "params": { "1": { "label": "Year", "description": "A four-digit number indicating the year", "example": "2017", "type": "number", "required": true }, "2": { "label": "Month", "description": "A number between 1 and 12 indicating the month", "example": "12", "type": "number", "suggested": true }, "3": { "label": "Day", "description": "A number between 1 and 31 indicating the day of the month", "example": "31", "type": "number", "suggested": true }, "df": { "label": "Display date first", "description": "Set to 'yes' to show the day before the month name", "type": "line", "suggestedvalues": [ "yes", "y" ] }, "paren": { "aliases": [ "p" ], "label": "Display with parentheses", "description": "Set to 'yes' to display the age within parentheses. When this parameter is not included, the date and age are separated by a semicolon and a breaking space.", "type": "line", "suggestedvalues": [ "yes", "y" ] }, "br": { "label": "Line break between date and age", "description": "Set to 'yes' to add a line break between the date and the age. When this parameter is not included, a breaking space will be inserted between the date and the age. This does not change the separating characters between the date and age which are either a semicolon (default setting) or parentheses (if paren=yes).", "type": "line", "suggestedvalues": [ "yes", "y" ] } }, "description": "The Start date and age template displays the date that an event or entity started or was created." } </templatedata> {{collapse bottom}} == Use in microformats == {{UF-date-part}} === Example === {{nowiki template demo|format=inline|output=nowiki+|code=<nowiki>{{Start date and age|2016|12|31}}</nowiki>}} ==Usage in articles== This template is most often used in infoboxes in articles about buildings or organizations, identifying when they were started/founded/opened or dissolved/ended/closed. It has also been used for naval ships to indicate their commissioned age; however, several Wikipedia editors have reverted such edits. Use of this template in ship articles is therefore not recommended. == Tracking categories == * {{clc|Pages using start date an age with invalid values}} * {{clc|Pages using start date and age with unknown parameters}} == See also == * {{tl|Start date}} * {{tl|End date and age}} * {{tl|Time ago}} and {{tl|Years or months ago}} * {{tl|Age}} {{Birth, death and age templates|dates}} <includeonly>{{Sandbox other| | <!-- Categories go here and interwikis go in Wikidata --> [[Category:Date-computing templates based on current time]] }}</includeonly>
摘要:
请注意,所有对代码酷的贡献均被视为依照知识共享署名-非商业性使用-相同方式共享发表(详情请见
代码酷:著作权
)。如果您不希望您的文字作品被随意编辑和分发传播,请不要在此提交。
您同时也向我们承诺,您提交的内容为您自己所创作,或是复制自公共领域或类似自由来源。
未经许可,请勿提交受著作权保护的作品!
取消
编辑帮助
(在新窗口中打开)
该页面使用的模板:
模板:Aligned table
(
编辑
)
模板:Birth, death and age templates
(
编辑
)
模板:COinS safe
(
编辑
)
模板:Category link with count
(
编辑
)
模板:Clc
(
编辑
)
模板:Collapse bottom
(
编辑
)
模板:Collapse top
(
编辑
)
模板:Collapse top/styles.css
(
编辑
)
模板:Documentation subpage
(
编辑
)
模板:High-use
(
编辑
)
模板:Hlist/styles.css
(
编辑
)
模板:Ifsubst
(
编辑
)
模板:Lua
(
编辑
)
模板:MONTHNAME
(
编辑
)
模板:MONTHNUMBER
(
编辑
)
模板:Main other
(
编辑
)
模板:Mbox
(
编辑
)
模板:Navbox with collapsible groups
(
编辑
)
模板:No redirect
(
编辑
)
模板:Nowiki template demo
(
编辑
)
模板:Ombox
(
编辑
)
模板:Para
(
编辑
)
模板:Plainlist/styles.css
(
编辑
)
模板:Resize
(
编辑
)
模板:Sandbox other
(
编辑
)
模板:Start date and age
(
编辑
)
模板:Start date and age/sandbox
(
编辑
)
模板:Strong
(
编辑
)
模板:TemplateData header
(
编辑
)
模板:Template link
(
编辑
)
模板:Template link expanded
(
编辑
)
模板:Template link with bold
(
编辑
)
模板:Template link with link off
(
编辑
)
模板:Template other
(
编辑
)
模板:Template parameter usage
(
编辑
)
模板:Template shortcut
(
编辑
)
模板:Terminate sentence
(
编辑
)
模板:Time ago
(
编辑
)
模板:Tl
(
编辑
)
模板:Tlb
(
编辑
)
模板:Tlx
(
编辑
)
模板:Trim
(
编辑
)
模板:UF-date-part
(
编辑
)
模板:UF-date-warn
(
编辑
)
模板:Var
(
编辑
)
模板:Years or months ago
(
编辑
)
模板:Yesno
(
编辑
)
模板:Yesno-no
(
编辑
)
模板:\
(
编辑
)
模块:Aligned table
(
编辑
)
模块:Arguments
(
编辑
)
模块:Check for unknown parameters
(
编辑
)
模块:Date
(
编辑
)
模块:High-use
(
编辑
)
模块:List
(
编辑
)
模块:Lua banner
(
编辑
)
模块:Message box
(
编辑
)
模块:Message box/configuration
(
编辑
)
模块:Message box/ombox.css
(
编辑
)
模块:Navbar
(
编辑
)
模块:Navbar/configuration
(
编辑
)
模块:Navbar/styles.css
(
编辑
)
模块:Navbox
(
编辑
)
模块:Navbox/configuration
(
编辑
)
模块:Navbox/styles.css
(
编辑
)
模块:Protect
(
编辑
)
模块:Redirect
(
编辑
)
模块:Shortcut
(
编辑
)
模块:Shortcut/config
(
编辑
)
模块:Shortcut/styles.css
(
编辑
)
模块:String
(
编辑
)
模块:TableTools
(
编辑
)
模块:Template invocation
(
编辑
)
模块:Template link general
(
编辑
)
模块:Template test case
(
编辑
)
模块:Template test case/config
(
编辑
)
模块:Template test case/data
(
编辑
)
模块:Time ago
(
编辑
)
模块:Transclusion count
(
编辑
)
模块:Transclusion count/data/S
(
编辑
)
模块:Yesno
(
编辑
)