Template talk:Age
From Wikipedia, the free encyclopedia
Template:age (talk, backlinks, edit).
See also Template:bha (talk, backlinks, edit) and Template:bdha (talk, backlinks, edit).
Contents |
[edit] Documentation
This template returns the number of full years between two dates, or between a specified date and today (UTC).
- Syntax:
- {{Age|year1|month1|day1|year2|month2|day2}}
- {{Age|year1|month1|day1}}
Examples:
- {{age|1989|7|23|2003|7|14}} gives 13<noinclude>
Template:age (talk, backlinks, edit).
This template returns the number of full years elapsed from one date until another date or until today (UTC). See Template talk:Age for examples.
If you use this template for calculating someone's age at death or age at a certain date (rather than their current age), please substitute it into the page, for example: {{subst:age|1989|7|23|2003|7|14}}.
da:Skabelon:Alder [[sl:Template:Leta]
- {{age|1989|7|23}} gives 17<noinclude>
Template:age (talk, backlinks, edit).
This template returns the number of full years elapsed from one date until another date or until today (UTC). See Template talk:Age for examples.
If you use this template for calculating someone's age at death or age at a certain date (rather than their current age), please substitute it into the page, for example: {{subst:age|1989|7|23|2003|7|14}}.
da:Skabelon:Alder [[sl:Template:Leta]
[edit] Discussion
Ever wonder how old your favorite child actor is? This template will help you satisfy your curiosity.
You can't just subtract the kid's birth year from the current year...
- 23 July 1989 - 17 (boy)
- 23 February 1994 - 12 (girl)
Be the first to identify the well-known actor whose birthdate and age are shown above! --Uncle Ed 20:14, 21 April 2006 (UTC)
Instead of checking the current age, you can also specify the date on which the age is measured, by passing 3 additional parameters. --Misza13 T C 12:17, 24 April 2006 (UTC)
- Call it {{years between}}? --Uncle Ed 15:55, 24 April 2006 (UTC)
- No, I forgot that we can employ optional parameters. Your version is just fine. Let's just wait for the deletion votes to be tabulated, and then we can really start using the template. I have a whole bunch of ideas. --Uncle Ed 18:57, 24 April 2006 (UTC)
[edit] Tests
{{Age|{{CURRENTYEAR}}-19|{{CURRENTMONTH}}|{{CURRENTDAY}}}} = 19<noinclude>
Template:age (talk, backlinks, edit).
This template returns the number of full years elapsed from one date until another date or until today (UTC). See Template talk:Age for examples.
If you use this template for calculating someone's age at death or age at a certain date (rather than their current age), please substitute it into the page, for example: {{subst:age|1989|7|23|2003|7|14}}.
da:Skabelon:Alder [[sl:Template:Leta]
{{Age|{{CURRENTYEAR}}-18|{{CURRENTMONTH}}-1|{{CURRENTDAY}}}} = 18<noinclude>
Template:age (talk, backlinks, edit).
This template returns the number of full years elapsed from one date until another date or until today (UTC). See Template talk:Age for examples.
If you use this template for calculating someone's age at death or age at a certain date (rather than their current age), please substitute it into the page, for example: {{subst:age|1989|7|23|2003|7|14}}.
da:Skabelon:Alder [[sl:Template:Leta]
{{Age|{{CURRENTYEAR}}-18|{{CURRENTMONTH}}|{{CURRENTDAY}}-1}} = 18<noinclude>
Template:age (talk, backlinks, edit).
This template returns the number of full years elapsed from one date until another date or until today (UTC). See Template talk:Age for examples.
If you use this template for calculating someone's age at death or age at a certain date (rather than their current age), please substitute it into the page, for example: {{subst:age|1989|7|23|2003|7|14}}.
da:Skabelon:Alder [[sl:Template:Leta]
{{Age|{{CURRENTYEAR}}-18|{{CURRENTMONTH}}|{{CURRENTDAY}}}} = 18<noinclude>
Template:age (talk, backlinks, edit).
This template returns the number of full years elapsed from one date until another date or until today (UTC). See Template talk:Age for examples.
If you use this template for calculating someone's age at death or age at a certain date (rather than their current age), please substitute it into the page, for example: {{subst:age|1989|7|23|2003|7|14}}.
da:Skabelon:Alder [[sl:Template:Leta]
{{Age|{{CURRENTYEAR}}-18|{{CURRENTMONTH}}|{{CURRENTDAY}}+1}} = 17<noinclude>
Template:age (talk, backlinks, edit).
This template returns the number of full years elapsed from one date until another date or until today (UTC). See Template talk:Age for examples.
If you use this template for calculating someone's age at death or age at a certain date (rather than their current age), please substitute it into the page, for example: {{subst:age|1989|7|23|2003|7|14}}.
da:Skabelon:Alder [[sl:Template:Leta]
{{Age|{{CURRENTYEAR}}-18|{{CURRENTMONTH}}+1|{{CURRENTDAY}}}} = 17<noinclude>
Template:age (talk, backlinks, edit).
This template returns the number of full years elapsed from one date until another date or until today (UTC). See Template talk:Age for examples.
If you use this template for calculating someone's age at death or age at a certain date (rather than their current age), please substitute it into the page, for example: {{subst:age|1989|7|23|2003|7|14}}.
da:Skabelon:Alder [[sl:Template:Leta]
{{Age|{{CURRENTYEAR}}-17|{{CURRENTMONTH}}|{{CURRENTDAY}}}} = 17<noinclude>
Template:age (talk, backlinks, edit).
This template returns the number of full years elapsed from one date until another date or until today (UTC). See Template talk:Age for examples.
If you use this template for calculating someone's age at death or age at a certain date (rather than their current age), please substitute it into the page, for example: {{subst:age|1989|7|23|2003|7|14}}.
da:Skabelon:Alder [[sl:Template:Leta]
{{Age|{{CURRENTYEAR}}|{{CURRENTMONTH}}|{{CURRENTDAY}}}} = 0<noinclude>
Template:age (talk, backlinks, edit).
This template returns the number of full years elapsed from one date until another date or until today (UTC). See Template talk:Age for examples.
If you use this template for calculating someone's age at death or age at a certain date (rather than their current age), please substitute it into the page, for example: {{subst:age|1989|7|23|2003|7|14}}.
da:Skabelon:Alder [[sl:Template:Leta]
[edit] Deletion controversy
See templates for deletion. [1]
[edit] Date format
While this is a great template, I must say that I don't like that the (american?) MM/DD/YYYY format was chosen. I propose that we quickly switch to ISO 8601 YYYY/MM/DD and fix all current uses before it gets massively widespread. Misza13 T C 12:21, 24 April 2006 (UTC)
- The usage is already using the ISO format... Documentation was added, template was correctly categorized, and more tests were added. verdy_p 15:46, 5 May 2006 (UTC)
-
- it makes the adjustment automatically , where if you set (My preferences/Date and Time) to show MM/DD/YYYY the article will show as an example May 13, 2009 where if the user has thier preferences set to DD/MM/YYYY they would see 13 May. 2009 on the same page.Make sure you delete Temporary Internet files after the change to preferences or you'll may see no change. Would be nice to have a bot replace all dates (such as dob's) in all articles with the date template --Sirex98 18:52, 11 October 2006 (UTC)
[edit] TfD nomination of Template:Age
Template:Age has been nominated for deletion. You are invited to comment on the discussion at the template's entry on the Templates for Deletion page. Thank you. FuriousFreddy 07:06, 2 July 2006 (UTC)
[edit] Please add current date to the display
For this template to be of real use, it needs to display the date when the age was calculated. This helps to time-proof such time-sensitive information. The date calculated would be shown for permanent media like a print or CD version, while the date calculated could be hidden for dynamic, current versions online. See User_talk:Cyde#Ages_and_updating_articles. Carcharoth 02:41, 21 July 2006 (UTC)
- PS. This only applies to living people of course. Once someone is dead, the ages can be calculated and permanently edited in to the article. As indeed should ages for living people for what they did in the past. It is only the current age of living people that this applies to. Carcharoth 02:44, 21 July 2006 (UTC)
- Pleas see Wikipedia:Village pump (policy)#Age in biographical articles. Jon513 06:58, 21 July 2006 (UTC)
- I came here from that discussion! See my comments in that discussion. :-) Carcharoth 14:57, 21 July 2006 (UTC)
- Pleas see Wikipedia:Village pump (policy)#Age in biographical articles. Jon513 06:58, 21 July 2006 (UTC)
[edit] Lousy Hack inc. code
{{#expr:{{#time:Y|1970-01-01 00:00:00 +{{#expr:{{#time:U|{{{1|today}}}}}-{{#time:U|{{{1|2000-12-12}}}}}}} seconds}}-1970}}
→AzaToth 18:05, 7 November 2006 (UTC)
- Not sure what that's supposed to do. My calculation of age is meant to become one higher on the person's birthday. If you're born on Dec. 25th, 1990, then you are 15 years old until 12/24/2006. On 12/25/2006 you 'gain' an entire year overnight.
- If we need a template to give fractional years, that's fine. Call it {{fractional age}} or {{decimal age}} or something. --Uncle Ed 20:03, 7 November 2006 (UTC)
[edit] Documentation
Is this #expr technique documented somewhere? Seems quite interesting for other purposes as well. --Abdull 14:01, 10 December 2006 (UTC).
- Found it: meta:ParserFunctions. --Abdull 14:04, 10 December 2006 (UTC)