Template:DATEDIFF2/doc

Description
For dates from 1 January 1970 onward only!

This template 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  ). This template is identical to DATEDIFF, except that it requires only that up to two parameters be inputted instead of up to twelve since it makes use of the  parser function.

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 onward only.