Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Special pages
Kid Dancers Wiki
Search
Search
Appearance
Appearance
move to sidebar
hide
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
Template:Age/doc
Template
Discussion
English
Read
Edit source
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit source
View history
General
What links here
Related changes
Page information
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
{{Documentation subpage}} {{High-use}} {{Lua|Module:Age|Module:Date}} == Usage == This template returns the number of full years between two specified dates. If the second set of parameters is not included, it returns the number of full years between a specified date and today's date. Dates are checked for validity. For example, 29 February 2000 is accepted, but 29 February 1900, 1800 or 2100 are not valid dates. : <code><nowiki>{{age|1892|1|31|1900|2|29}}</nowiki></code> β <span id="FormattingError"></span><strong class="error">Error: Second date should be year, month, day</strong> : <code><nowiki>{{age|1789|5|1|1800|2|29}}</nowiki></code> β <span id="FormattingError"></span><strong class="error">Error: Second date should be year, month, day</strong> Partial dates such as July 1989 (no day) or 1989 (no month and no day) can be entered using <code>0</code> for missing values. Having no year, or having a day with no month is an error. Please remember to avoid phrasings such as "17 years ago" or "Jones is 65 years old", even when they use this template. See [[MOS:RELTIME]] for more information. For the [[Supercentenarian]]s, use {{no redirect|Template:Age in years and days|<nowiki>{{age in years and days}}</nowiki>}} template. ; Syntax: : <code><nowiki>{{</nowiki>age|''year''|''month''|''day''|''year2''|''month2''|''day2''}}</code> {{green|or}} : <code><nowiki>{{</nowiki>age|''year''|''month''|''day''}}</code> {{green|or}} : <code><nowiki>{{</nowiki>age|''date''|''date2''}}</code> {{green|or}} : <code><nowiki>{{</nowiki>age|''date''}}</code> ; Examples: : <code><nowiki>{{</nowiki>age|1989|7|23|2003|7|14}}</code> β {{age|1989|7|23|2003|7|14}} : <code><nowiki>{{</nowiki>age|1989|7|0|2003|7|14}}</code> β {{age|1989|7|0|2003|7|14}} : <code><nowiki>{{</nowiki>age|1989|0|0|2003|7|14}}</code> β {{age|1989|0|0|2003|7|14}} : <code><nowiki>{{</nowiki>age|1989|7|23}}</code> β {{age|1989|7|23}} : <code><nowiki>{{</nowiki>age|23 July 1989|14 July 2003}}</code> β {{age|23 July 1989|14 July 2003}} : <code><nowiki>{{</nowiki>age|July 1989|2003}}</code> β {{age|July 1989|2003}} : When entering dates before the [[Common Era]], use astronomical year numbering: 1 BCE is represented by <code>0</code>, 2 BCE by <code>-1</code>, 3 BCE by <code>-2</code> etc. For example, the following gives the number of full years since the battle of Cannae, which took place on August 2, 216 BCE: :: <code><nowiki>{{</nowiki>age|-215|8|2}}</code> β {{age|-215|8|2}} :: <code><nowiki>{{</nowiki>age|August 2, 216 BCE}}</code> β {{age|August 2, 216 BCE}} The options described at [[Module:Age]] can be used, for example: :: <code><nowiki>{{</nowiki>age|format=commas|-215|8|2}}</code> β {{age|format=commas|-215|8|2}} :: <code><nowiki>{{</nowiki>age|format=cardinal|1970|1|1|1998|2|1}}</code> β {{age|format=cardinal|1970|1|1|1998|2|1}} :: <code><nowiki>{{</nowiki>age|format=ordinal|1970|1|1|1998|2|1}}</code> β {{age|format=ordinal|1970|1|1|1998|2|1}} When only one date is entered, the current date is used for the other date. The template outputs a span that can be used by a calling infobox to detect if only one date was used. The following shows two examples with the exact wikitext that is produced, as seen at [[Special:ExpandTemplates]]: :: <code><nowiki>{{</nowiki>age|2010}}</code> β <code><span class="currentage"></span>{{age|format=raw|2010}}</code> :: <code><nowiki>{{</nowiki>age|format=raw|2010}}</code> β <code>{{age|format=raw|2010}}</code> == TemplateData == {{TemplateDataHeader}} <templatedata>{ "description": "This template returns the number of full years between two specified dates. If the second set of parameters is not included, it will return the number of full years between a specified date and today's date.", "params": { "1": { "label": "Year (\"from\" date)", "description": "The year of the \"from\" date", "type": "number", "required": true }, "2": { "label": "Month (\"from\" date)", "description": "The month of the \"from\" date, 1 through 12", "type": "number", "required": true }, "3": { "label": "Day (\"from\" date)", "description": "The day (of month) of the \"from\" date, 1 through 31", "type": "number", "required": true }, "4": { "label": "Year2 (\"to\" date)", "description": "The year of the \"to\" date, if required", "type": "number", "required": false, "default": "{{CURRENTYEAR}}" }, "5": { "label": "Month2 (\"to\" date)", "description": "The month of the \"to\" date, if required", "type": "number", "required": false, "default": "{{CURRENTMONTH}}" }, "6": { "label": "Day2 (\"to\" date)", "description": "The day (of month) of the \"to\" date, if required", "type": "number", "required": false, "default": "{{CURRENTDAY}}" }, "format": { "label": "Format", "description": "Date format", "type": "string", "required": false, "suggestedvalues": [ "commas", "raw", "cardinal", "ordinal" ] } }} </templatedata> == See also == * [[Template:Start date and age]] * [[Template:Years ago]] β number of years in the past * [[MOS:RELTIME]] β guideline on relative time references {{Birth, death and age templates|age}} <includeonly>{{Sandbox other|| <!-- Categories below this line, please; interwikis at Wikidata --> [[Category:Date mathematics templates]] }}</includeonly>
Summary:
Please note that all contributions to Kid Dancers Wiki are considered to be released under the Creative Commons Attribution (see
Kid Dancers Wiki:Copyrights
for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource.
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Templates used on this page:
Template:Age
(
edit
)
Template:Birth, death and age templates
(
edit
)
Template:Documentation subpage
(
edit
)
Template:Green
(
edit
)
Template:High-use
(
edit
)
Template:Lua
(
edit
)
Template:Mbox
(
edit
)
Template:No redirect
(
edit
)
Template:Strong
(
edit
)
Template:TemplateDataHeader
(
edit
)
Template:Terminate sentence
(
edit
)
Module:Age
(
edit
)
Module:Arguments
(
edit
)
Module:ConvertNumeric
(
edit
)
Module:Date
(
edit
)
Module:High-use
(
edit
)
Module:Message box
(
edit
)
Module:Message box/configuration
(
edit
)
Module:Message box/ombox.css
(
edit
)
Module:Text
(
edit
)
Module:Transclusion count
(
edit
)
Module:Transclusion count/data/A
(
edit
)
Module:Yesno
(
edit
)
Search
Search
Editing
Template:Age/doc
Add topic