<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.runerealm.org/index.php?action=history&amp;feed=atom&amp;title=Template%3ADateDiff%2Fdoc</id>
	<title>Template:DateDiff/doc - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.runerealm.org/index.php?action=history&amp;feed=atom&amp;title=Template%3ADateDiff%2Fdoc"/>
	<link rel="alternate" type="text/html" href="https://wiki.runerealm.org/index.php?title=Template:DateDiff/doc&amp;action=history"/>
	<updated>2026-05-01T15:37:28Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.41.1</generator>
	<entry>
		<id>https://wiki.runerealm.org/index.php?title=Template:DateDiff/doc&amp;diff=35730&amp;oldid=prev</id>
		<title>Alex: Created page with &quot;{{Documentation}} :&#039;&#039;This template is only applicable for dates from 1 January 1970 onwards only.&#039;&#039;  The &#039;&#039;&#039;DateDiff&#039;&#039;&#039; returns the difference in days (possibly with decimals) between two dates in the Gregorian calendar.  The return value is positive if &lt;code&gt;date2&lt;/code&gt; comes &#039;&#039;after&#039;&#039; &lt;code&gt;date1&lt;/code&gt;, and is negative if &lt;code&gt;date2&lt;/code&gt; comes &#039;&#039;before&#039;&#039; &lt;code&gt;date1&lt;/code&gt; (i.e. the template computes &lt;code&gt;date2 - date1&lt;/code&gt;).   ===Usage=== If two dates supplied...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.runerealm.org/index.php?title=Template:DateDiff/doc&amp;diff=35730&amp;oldid=prev"/>
		<updated>2024-10-16T23:23:03Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;{{Documentation}} :&amp;#039;&amp;#039;This template is only applicable for dates from 1 January 1970 onwards only.&amp;#039;&amp;#039;  The &amp;#039;&amp;#039;&amp;#039;DateDiff&amp;#039;&amp;#039;&amp;#039; returns the difference in days (possibly with decimals) between two dates in the Gregorian calendar.  The return value is positive if &amp;lt;code&amp;gt;date2&amp;lt;/code&amp;gt; comes &amp;#039;&amp;#039;after&amp;#039;&amp;#039; &amp;lt;code&amp;gt;date1&amp;lt;/code&amp;gt;, and is negative if &amp;lt;code&amp;gt;date2&amp;lt;/code&amp;gt; comes &amp;#039;&amp;#039;before&amp;#039;&amp;#039; &amp;lt;code&amp;gt;date1&amp;lt;/code&amp;gt; (i.e. the template computes &amp;lt;code&amp;gt;date2 - date1&amp;lt;/code&amp;gt;).   ===Usage=== If two dates supplied...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{Documentation}}&lt;br /&gt;
:&amp;#039;&amp;#039;This template is only applicable for dates from 1 January 1970 onwards only.&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The &amp;#039;&amp;#039;&amp;#039;DateDiff&amp;#039;&amp;#039;&amp;#039; returns the difference in days (possibly with decimals) between two dates in the Gregorian calendar.  The return value is positive if &amp;lt;code&amp;gt;date2&amp;lt;/code&amp;gt; comes &amp;#039;&amp;#039;after&amp;#039;&amp;#039; &amp;lt;code&amp;gt;date1&amp;lt;/code&amp;gt;, and is negative if &amp;lt;code&amp;gt;date2&amp;lt;/code&amp;gt; comes &amp;#039;&amp;#039;before&amp;#039;&amp;#039; &amp;lt;code&amp;gt;date1&amp;lt;/code&amp;gt; (i.e. the template computes &amp;lt;code&amp;gt;date2 - date1&amp;lt;/code&amp;gt;). &lt;br /&gt;
&lt;br /&gt;
===Usage===&lt;br /&gt;
If two dates supplied, the template calculates the difference between them, in days.  If only one date is supplied, then the supplied date is calculated against the current date.  If no dates are supplied, the template calculates the number of days from the start of the [[Wikipedia:Julian epoch|Julian epoch]] to the current date.  If an invalid date is supplied, then the text is returned unaltered.&lt;br /&gt;
&lt;br /&gt;
The inputted dates may be in any format understood by the &amp;lt;code&amp;gt;#time:&amp;lt;/code&amp;gt; parser function. (e.g. &amp;lt;code&amp;gt;July 18, 2008&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;18 July 2008&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;2008-07-18&amp;lt;/code&amp;gt; are all valid.)  Hours, minutes and seconds can likewise be inputted.&lt;br /&gt;
&lt;br /&gt;
This template can be used for dates from 1 January 1970 onwards only.&lt;br /&gt;
&lt;br /&gt;
===Examples===&lt;br /&gt;
:{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Code !! Output&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{DateDiff|18 July 2008|2008-07-16}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
| {{DateDiff|18 July 2008|2008-07-16}}&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{DateDiff|July 16, 2008 8PM|2008-07-18 8:00:00}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
| {{DateDiff|July 16, 2008 8PM|2008-07-18 8:00:00}}&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{DateDiff|2008-07-18}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
| {{DateDiff|2008-07-18}}&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{DateDiff|{{#time:c}}}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
| &amp;#039;&amp;#039;should always equal zero&amp;#039;&amp;#039;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{DateDiff}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
| {{DateDiff}}&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{DateDiff|invalid}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
| {{DateDiff|invalid}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
* [[:Template:JulianDay]] - used in this template&lt;br /&gt;
&amp;lt;includeonly&amp;gt;[[Category:Mathematical templates|{{PAGENAME}}]]&amp;lt;/includeonly&amp;gt;&lt;/div&gt;</summary>
		<author><name>Alex</name></author>
	</entry>
</feed>