Template:Date difference: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
(Testing this, might get deleted!)
 
m (Add usage info)
 
Line 63: Line 63:
  }}{{#ifexpr: {{{year1|{{{1|{{CURRENTYEAR}}}}}}}} < 1 |
  }}{{#ifexpr: {{{year1|{{{1|{{CURRENTYEAR}}}}}}}} < 1 |
         _ERROR - Can not handle dates before January 1, 1 A.D.
         _ERROR - Can not handle dates before January 1, 1 A.D.
   }} }} }}</includeonly>
   }} }} }}</includeonly><noinclude>== Usage ==
:<code><nowiki>{{</nowiki>|month1= |day1= |year1= |month2= |day2= | year2=<nowiki>}}</nowiki></code>
 
This template returns the number of days between two dates. With unnamed parameters:
 
:<code><nowiki>{{</nowiki>date difference|''year1''|''month1''|''day1''|''year2''|''month2''|''day2''<nowiki>}}</nowiki></code>
 
With unnamed parameters, calculating the days between today and the given date:
 
:<code><nowiki>{{</nowiki>date difference|''year1''|''month1''|''day1''<nowiki>}}</nowiki></code>
 
== Examples ==
*<nowiki>{{date difference|2007|5|24|2008|4|23}}</nowiki> gives {{date difference|2007|5|24|2008|4|23}}
*<nowiki>{{date difference|2007|5|24}}</nowiki> gives {{date difference|2007|5|24}}
*<nowiki>{{date difference|2009|9|7}}</nowiki> gives {{date difference|2009|9|7}}
*<nowiki>{{date difference|2009|10|29}}</nowiki> gives {{date difference|2009|10|29}}
== See More ==
* [https://en.wikipedia.org/wiki/Template:Date_difference Original template] from Wikipedia
</noinclude>

Latest revision as of 17:11, 6 September 2018

Usage

{{|month1= |day1= |year1= |month2= |day2= | year2=}}

This template returns the number of days between two dates. With unnamed parameters:

{{date difference|year1|month1|day1|year2|month2|day2}}

With unnamed parameters, calculating the days between today and the given date:

{{date difference|year1|month1|day1}}

Examples

  • {{date difference|2007|5|24|2008|4|23}} gives 335
  • {{date difference|2007|5|24}} gives 6,395
  • {{date difference|2009|9|7}} gives 5,558
  • {{date difference|2009|10|29}} gives 5,506

See More