Template talk:Age

From Wikipedia, the free encyclopedia

Protected Template:Age has been protected indefinitely. Use {{editprotected}} on this page to request an edit.
Articles for deletion
This page was previously nominated for deletion.
Please see prior discussion(s) before considering re-nomination:

Template:age (talk, backlinks, edit).

See also 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
  • {{age|1989|7|23}} gives 17

[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 - 13 (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)
And make it a redirect to {{age}}? :) --Misza13 T C 17:20, 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

{{Age|{{CURRENTYEAR}}-18|{{CURRENTMONTH}}-1|{{CURRENTDAY}}}} = 18

{{Age|{{CURRENTYEAR}}-18|{{CURRENTMONTH}}|{{CURRENTDAY}}-1}} = 18

{{Age|{{CURRENTYEAR}}-18|{{CURRENTMONTH}}|{{CURRENTDAY}}}} = 18

{{Age|{{CURRENTYEAR}}-18|{{CURRENTMONTH}}|{{CURRENTDAY}}+1}} = 17

{{Age|{{CURRENTYEAR}}-18|{{CURRENTMONTH}}+1|{{CURRENTDAY}}}} = 17

{{Age|{{CURRENTYEAR}}-17|{{CURRENTMONTH}}|{{CURRENTDAY}}}} = 17

{{Age|{{CURRENTYEAR}}|{{CURRENTMONTH}}|{{CURRENTDAY}}}} = 0

[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)

[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)

[edit] Interwiki link to the Vietnamese Wikipedia

Please add an interwiki link to the Vietnamese version of this template:

[[vi:Tiêu bản:Tuổi]]

Thanks.

 – Minh Nguyễn (talk, contribs) 06:34, 24 January 2007 (UTC)

Done Luna Santin 08:57, 24 January 2007 (UTC)

[edit] Separate description

Please separate the description and other non-code content from the protected code, similar to what has been done with other templates. --PhantomS 09:46, 24 January 2007 (UTC)

Can you clarify what you mean, or give an example? Chick Bowen 19:04, 26 January 2007 (UTC)
I was thinking of something similar to what was done for {{Infobox actor}}, where the documentation is transcluded. In addition, please add a {{protected template}}. --PhantomS 19:11, 26 January 2007 (UTC)
Done. Please note that the documentation could use some expansion. Chick Bowen 19:19, 26 January 2007 (UTC)
Never mind--there's something weird going on--can you check my edit (since reverted)? Chick Bowen 19:27, 26 January 2007 (UTC)
It seems you've accidentally inserted an image tag into the code part. --PhantomS 19:30, 26 January 2007 (UTC)
Sorry, figured that out--now it's done. Chick Bowen 19:31, 26 January 2007 (UTC)
Thank you. --PhantomS 19:33, 26 January 2007 (UTC)

[edit] History

Wow! A template I created has become so popular that it has been protected. How ironic, as I am no longer an admin and cannot even change it myself! :-) --Uncle Ed 12:04, 23 February 2007 (UTC)