Difference between revisions of "Template:Get-year"

From FamilyTree
Jump to navigation Jump to search
(Created page with "<includeonly>{{#ifeq:"{{lc:{{{1|1900}}}}}"|"{{Four digit|{{#expr:{{{1|1900}}}}}}}"|{{{1|1900}}}|{{#time:Y|{{{1|November 1, 1900}}} }}}}</includeonly&...")
 
 
Line 1: Line 1:
&lt;includeonly&gt;{{#ifeq:&quot;{{lc:{{{1|1900}}}}}&quot;|&quot;{{Four digit|{{#expr:{{{1|1900}}}}}}}&quot;|{{{1|1900}}}|{{#time:Y|{{{1|November 1, 1900}}} }}}}&lt;/includeonly&gt;&lt;noinclude&gt;
+
<includeonly>{{#ifeq:"{{lc:{{{1|1900}}}}}"|"{{Four digit|{{#expr:{{{1|1900}}}}}}}"|{{{1|1900}}}|{{#time:Y|{{{1|November 1, 1900}}} }}}}</includeonly><noinclude>
 
'''Purpose''': Given a plain text date, returns the year.  accepts ISO8601, a variety of date formats as well as year only specification of date.   
 
'''Purpose''': Given a plain text date, returns the year.  accepts ISO8601, a variety of date formats as well as year only specification of date.   
  
Line 5: Line 5:
  
 
[[Category:Date mathematics templates]]
 
[[Category:Date mathematics templates]]
&lt;/noinclude&gt;
+
</noinclude>

Latest revision as of 16:05, 10 October 2010

Purpose: Given a plain text date, returns the year. accepts ISO8601, a variety of date formats as well as year only specification of date.

Limitations: does understand BC/ AD and may not deliver accurate results for single digit dates.