Template:DateDiff/doc


 * This template is only applicable for dates from 1 January 1970 onwards only.

The DateDiff returns the difference in days (possibly with decimals) between two dates in the Gregorian calendar. The return value is positive if  comes after , and is negative if   comes before   (i.e. the template computes  ).

Usage
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 Julian epoch to the current date. If an invalid date is supplied, then the text is returned unaltered.

The inputted dates may be in any format understood by the  parser function. (e.g.,   and   are all valid.)  Hours, minutes and seconds can likewise be inputted.

This template can be used for dates from 1 January 1970 onwards only.

Examples

 * {| class="wikitable"

! Code !! Output
 * should always equal zero
 * }
 * should always equal zero
 * }
 * should always equal zero
 * }
 * should always equal zero
 * }
 * should always equal zero
 * }
 * should always equal zero
 * }
 * }
 * }
 * }
 * }
 * }
 * }
 * }