Help us get to over 8,748 articles in 2024.

If you know of a magician not listed in MagicPedia, start a New Biography for them. Contact us at magicpediahelp@gmail.com

Difference between revisions of "Template:Age2"

From Magicpedia, the free online encyclopedia for magicians by magicians.
Jump to: navigation, search
m
m
 
(6 intermediate revisions by the same user not shown)
Line 6: Line 6:
 
   ( {{#if:{{{4|}}}|{{MONTHNUMBER|{{#explode:{{{4}}} 31| |0}} }}|{{CURRENTMONTH}}  }})
 
   ( {{#if:{{{4|}}}|{{MONTHNUMBER|{{#explode:{{{4}}} 31| |0}} }}|{{CURRENTMONTH}}  }})
 
   <
 
   <
     ({{MONTHNUMBER|{{#explode:{{{2}}}| |0}} }})
+
     ({{MONTHNUMBER|{{#explode:{{{2|December 31}}}| |0}} }})
 
     or
 
     or
 
     ({{#if:{{{4|}}}|{{MONTHNUMBER|{{#explode:{{{4}}} 31| |0}} }}|{{CURRENTMONTH}} }})
 
     ({{#if:{{{4|}}}|{{MONTHNUMBER|{{#explode:{{{4}}} 31| |0}} }}|{{CURRENTMONTH}} }})
 
     =
 
     =
     ({{MONTHNUMBER|{{#explode:{{{2}}}| |0}} }})
+
     ({{MONTHNUMBER|{{#explode:{{{2|December 31}}}| |0}} }})
 
     and
 
     and
     ({{#if:{{#pos:{{{4}}}| |1}}|{{#explode:{{#explode:{{#replace:{{{4}}}|of| }} 31| |1}}|,|0}}|{{CURRENTDAY}} }})
+
     ({{#if:{{#pos:{{{4}}}| |1}}|{{#explode:{{#explode:{{#replace:{{{4}}}|of|1}} 31| |1}}|,|0}}|{{CURRENTDAY}} }})
 
     <
 
     <
     ({{#if:{{#pos:{{{2}}}| |1}}|{{#explode:{{#explode:{{#replace:{{{2}}}|of|31}}| |1}}|,|0}}|31 }})
+
     ({{#if:{{#pos:{{{2|December 31}}}| |1}}|{{#explode:{{#explode:{{#replace:{{{2|December 31}}}|of|31}}| |1}}|,|0}}|31 }})
 
   )
 
   )
 
}}</includeonly><noinclude>
 
}}</includeonly><noinclude>
Line 25: Line 25:
 
day =  {{#explode:{{#explode:{{{2}}}| |1}}|,|0}}
 
day =  {{#explode:{{#explode:{{{2}}}| |1}}|,|0}}
 
-->
 
-->
 
+
 
+
  
 
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.
 
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.
Line 34: Line 33:
  
 
Examples:
 
Examples:
:<nowiki>{{age2|1962|July 23|2003|July 14}}</nowiki> returns "{{age2|1962|July 23|2003|July 14}}"
+
:<nowiki>{{age2|1962|February 23|2012|February 14}}</nowiki> returns "{{age2|1962|February 23|2012|February 14}}"
 +
:<nowiki>{{age2|1905|February 14|1981|February 5}}</nowiki> returns "{{age2|1905|February 14|1981|February 5}}"
 
:<nowiki>{{age2|1962|July 03|2003|July 04}}</nowiki> returns "{{age2|1962|July 03|2003|July 04}}"
 
:<nowiki>{{age2|1962|July 03|2003|July 04}}</nowiki> returns "{{age2|1962|July 03|2003|July 04}}"
 +
:<nowiki>{{age2|1962|July of|2003|July of}}</nowiki> returns "{{age2|1962|July 03|2003|July of}}"
 
:<nowiki>{{age2|1962|July|2003|July}}</nowiki> returns "{{age2|1962|July 23|2003|July 14}}"
 
:<nowiki>{{age2|1962|July|2003|July}}</nowiki> returns "{{age2|1962|July 23|2003|July 14}}"
 
:<nowiki>{{age2|1962||2003|}}</nowiki> returns "{{age2|1962||2003|}}"
 
:<nowiki>{{age2|1962||2003|}}</nowiki> returns "{{age2|1962||2003|}}"

Latest revision as of 00:50, 23 June 2012


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. Syntax:

{{age2|year1|month1 day1|year2|month2 day2}} or :{{age2|year1|month1 day1}}

Examples:

{{age2|1962|February 23|2012|February 14}} returns "49"
{{age2|1905|February 14|1981|February 5}} returns "75"
{{age2|1962|July 03|2003|July 04}} returns "41"
{{age2|1962|July of|2003|July of}} returns "40"
{{age2|1962|July|2003|July}} returns "40"
{{age2|1962||2003|}} returns "Expression error: Unrecognized word "missing"."
{{age2|1962|July 03|2003|July 04}} returns "41"
{{age2|1900|July 23}} returns "123"
{{age2|1900|July 23,}} returns "123"
{{age2|1900|July of}} returns "123"
{{age2|1962|circa|2003|July 14}} returns "40"
{{age2|1962|circa|2003|c.}} returns "40"

When using this template to calculate a person's age at death or a person's age on a specified date (rather than the person's current age), please substitute it into the page.

Example: {{subst:age2|1989|July 23|2003|July 14}}