This is documentation for Mathematica 8, which was
based on an earlier version of the Wolfram Language.

# DateDifference

 DateDifference gives the number of days from to . DateDifferencegives the difference between and in the specified unit. DateDifferencegives the difference as a list with elements corresponding to the successive .
• Dates can be specified in the following forms:
 {y,m,d} year, month, day {y,m} the first day of the specified month {y} January 1 of the year y "string" date as a string () {y,m,d,h,m,s} precise time time absolute time specification
• Possible units are , , , , , , , .
• is taken to be equivalent to , etc.
• DateDifference gives the fractional number of days from the current time until .
Give the number of days between January 1 and July 4:
Use dates specified in form:
Find a date difference in units of weeks:
If the second date is before the first, the date difference is negative:
Give the number of days between January 1 and July 4:
 Out[1]=

Use dates specified in form:
 Out[1]=

Find a date difference in units of weeks:
 Out[1]=

If the second date is before the first, the date difference is negative:
 Out[1]=
 Scope   (6)
Give dates in any format supported by DateString:
List and string date specifications can be mixed:
DateDifference can use times given in format:
Find the number of hours between two dates:
Find the number of years between two dates:
Find the difference between two dates in months and days:
 Applications   (1)
Find the number of years, months, and days since the beginning of the year 2000:
DatePlus adds time units to dates, while DateDifference computes units between dates:
The inverse relationship:
Date strings can be ambiguous:
Use DateList to disambiguate between different interpretations:
New in 6