Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Search
Search
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
Template:Birth based on age as of date/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
Special pages
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}} <!-- PLEASE ADD CATEGORIES WHERE INDICATED AT THE BOTTOM OF THIS PAGE --> {{Warning |''Do '''NOT''' use this template when the person is dead; consider {{tl|Birth based on age at death}} instead.''}} {{High-use}} {{Intricate template}} For a person whose date of birth is unknown, this template estimates the person's birth year and current age based on a given age at a certain date. This is useful when a [[wp:reliable source|reliable source]] states only their age at the time of publication. == Syntax == === Typical use === <syntaxhighlight lang="wikitext"> {{birth based on age as of date | age | year | month | day }} </syntaxhighlight> <div style="margin-left:1.6em;">Code:</div> <div style="margin-left:3.2em;"><code><nowiki>{{birth based on age as of date|50|</nowiki>{{#expr:{{CURRENTYEAR}}-2}}|{{#expr:12-{{CURRENTMONTH}}+1}}|{{CURRENTDAY}}<nowiki>}}</nowiki></code></div> <div style="margin-left:1.6em;">Result:</div> <div style="margin-left:3.2em;">{{birth based on age as of date|50|{{#expr:{{CURRENTYEAR}}-2}}|{{#expr:12-{{CURRENTMONTH}}+1}}|{{CURRENTDAY}}}} </div> The age, year, and day must be supplied as [[natural number]]s; month can be specified as a natural number as well as by name or abbreviation (e.g. "August" or "Aug"). The [[Gregorian calendar]] is assumed, with no special support provided for [[dual dating]] or the difference between [[Old Style and New Style dates]]. If only the publication year for a source is known, the "day" and "month" fields can be omitted. === No age === In some contexts—like the lead sentence of a biography—it may be desirable to show only the birth year, and not a person’s age. To suppress the age field, set {{para|noage|yes}}: <div style="margin-left:1.6em;">Code:</div> <div style="margin-left:3.2em;"><code><nowiki>{{birth based on age as of date|50|</nowiki>{{#expr:{{CURRENTYEAR}}-2}}|{{#expr:12-{{CURRENTMONTH}}+1}}|{{CURRENTDAY}}|noage=1|slash=y<nowiki>}}</nowiki></code></div> <div style="margin-left:1.6em;">Result:</div> <div style="margin-left:3.2em;">{{birth based on age as of date|50|{{#expr:{{CURRENTYEAR}}-2}}|{{#expr:12-{{CURRENTMONTH}}+1}}|{{CURRENTDAY}}|noage=1|slash=yes}}</div> === Separator === In general, the two possible birth years should be written out as: {{xt|1950 or 1951}}. In contexts which are tight for space, the separator between the two possible years should be a slash: {{xt|1950/1951}}. To use the <code>/</code> separator, add {{para|slash|yes}}. <div style="margin-left:1.6em;">Code:</div> <div style="margin-left:3.2em;"><code><nowiki>{{birth based on age as of date|50|</nowiki>{{#expr:{{CURRENTYEAR}}-2}}|{{#expr:12-{{CURRENTMONTH}}+1}}|{{CURRENTDAY}}|slash=yes<nowiki>}}</nowiki></code></div> <div style="margin-left:1.6em;">Result:</div> <div style="margin-left:3.2em;">{{birth based on age as of date|50|{{#expr:{{CURRENTYEAR}}-2}}|{{#expr:12-{{CURRENTMONTH}}+1}}|{{CURRENTDAY}}|slash=yes}}</div> == Examples == If, for example, a reference dated July 4, {{#expr:{{CURRENTYEAR}}-2}} mentions that someone is 50 years old, that person's birth year and age can be rendered using: <div style="margin-left:1.6em;"><code><nowiki>{{birth based on age as of date|50|</nowiki>{{#expr:{{CURRENTYEAR}}-2}}|July|4}}</code></div> {| class="plainlinksneverexpand" style="margin-top:0;" !style="border:1px solid #aaa;background:#dfd;"| The following examples are for a person reported as being 50 years old in {{#expr:{{CURRENTYEAR}}-1}} |- | {{Aligned table |class=wikitable |colstyle=padding-right:1.0em; |col1style=font-family:monospace;padding-right:1.0em; |row1header=on| {{sans-serif|Template code}} | Result | {{braces|birth based on age as of date|50|{{#expr:{{CURRENTYEAR}}-1}}|{{CURRENTMONTH}}|{{CURRENTDAY}}}} | {{birth based on age as of date|50|{{#expr:{{CURRENTYEAR}}-1}}|{{CURRENTMONTH}}|{{CURRENTDAY}}}} | {{braces|birth based on age as of date|50|{{#expr:{{CURRENTYEAR}}-1}}|{{CURRENTMONTHNAME}}|{{CURRENTDAY}}}} | {{birth based on age as of date|50|{{#expr:{{CURRENTYEAR}}-1}}|{{CURRENTMONTHNAME}}|{{CURRENTDAY}}}} | {{braces|birth based on age as of date|50|{{#expr:{{CURRENTYEAR}}-1}}|12|31}} | {{birth based on age as of date|50|{{#expr:{{CURRENTYEAR}}-1}}|12|31}} | {{braces|birth based on age as of date|50|{{#expr:{{CURRENTYEAR}}-1}}|Jan|1}} | {{birth based on age as of date|50|{{#expr:{{CURRENTYEAR}}-1}}|Jan|1}} | {{braces|birth based on age as of date|50|{{#expr:{{CURRENTYEAR}}-1}}|12|31|noage{{=}}1}} | {{birth based on age as of date|50|{{#expr:{{CURRENTYEAR}}-1}}|12|31|noage=1}} | {{braces|birth based on age as of date|50|{{#expr:{{CURRENTYEAR}}-1}}|Jan|1|noage{{=}}1}} | {{birth based on age as of date|50|{{#expr:{{CURRENTYEAR}}-1}}|Jan|1|noage=1}} | {{braces|birth based on age as of date|50|{{#expr:{{CURRENTYEAR}}-1}}|{{CURRENTMONTHNAME}}}} | {{birth based on age as of date|50|{{#expr:{{CURRENTYEAR}}-1}}|{{CURRENTMONTHNAME}}}} | {{braces|birth based on age as of date|50|{{#expr:{{CURRENTYEAR}}-1}}|Jan}} | {{birth based on age as of date|50|{{#expr:{{CURRENTYEAR}}-1}}|Jan}} | {{braces|birth based on age as of date|50|{{#expr:{{CURRENTYEAR}}-1}}|12}} | {{birth based on age as of date|50|{{#expr:{{CURRENTYEAR}}-1}}|12}} | {{braces|birth based on age as of date|50|{{#expr:{{CURRENTYEAR}}-1}}}} | {{birth based on age as of date|50|{{#expr:{{CURRENTYEAR}}-1}}}} }} |} {{Birth, death and age templates |BDA}} <includeonly>{{Sandbox other| | <!--PLEASE ADD CATEGORIES BELOW THIS LINE: --> [[Category:Date mathematics templates]] }}</includeonly> <templatedata> { "params": { "1": { "label": "Age", "description": "Age of subject at date of reference's publication.", "example": "55", "type": "number", "required": true }, "2": { "label": "Year", "description": "Year of publication of reference.", "example": "1950", "type": "number", "required": true }, "3": { "label": "Month", "description": "Month of publication of reference.", "example": "8 or August", "type": "string", "suggested": true }, "4": { "label": "Day", "description": "Day of publication of reference.", "example": "21", "type": "number", "suggested": true }, "noage": { "label": "Hide age", "description": "Set to a value of 'yes' to display year of birth without the age", "example": "1", "type": "boolean", "default": "no (i.e., the default is to show the age)" }, "slash": { "label": "Slash separator", "description": "Set to 'yes' to separate years with a '/' for tight spaces (e.g., table cells)", "suggestedvalues": [ "yes" ], "type": "boolean", "default": "no" } }, "description": "This template calculates the birth year and current age based on the age as of a date.", "format": "inline", "paramOrder": [ "1", "2", "3", "4", "noage", "slash" ] } </templatedata> ==Redirects== * [[Template:Bbad]] * [[Template:Birth year from age as of date]] * [[Template:Birth year from age at date]]
Summary:
Please note that all contributions to Red Letter Media Wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, 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 (see
RLMWiki:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Toggle limited content width