same as DateDifference, but faster?

Given that:

In[201]:= DateDifference[{2011, 1, 19}, {2011, 1, 18}]
Out[201]= -1

any alternate/creative methods to do the same thing faster?

In[195]:= Timing[Do[DateDifference[{2011, 1, 19}, {2011, 1, 18}], {1000}];]
Out[195]= {1.934, Null} 

There was a [detailed discussion about this on StackExchange. You’ll find fast implementations in the answers there.

There were also some [reports that this function got slower in 9 compared to 8.

I haven’t personally tested any of this.](http://mathematica.stackexchange.com/questions/17272/xkcdconvert-routines-perform-slower-in-mathematica-9#comment51251_17272)](http://mathematica.stackexchange.com/a/7265/12)

If you’re only interested in number of days and the dates in question don’t go through any historical calendar changes, you could use AbsoluteTime to convert to seconds between and then convert seconds to days:

In[11]:= DateDifference[{2011, 1, 19}, {2011, 1, 18}]
Out[11]= -1
In[12]:= Timing[Do[DateDifference[{2011, 1, 19}, {2011, 1, 18}], {1000}];]
Out[12]= {2.074813, Null}
In[13]:= newDateDiff[d1_, d2_]:= Round[(AbsoluteTime[d2] - AbsoluteTime[d1])/(24*60*60)]
In[14]:= newDateDiff[{2011, 1, 19}, {2011, 1, 18}]
Out[14]= -1
In[15]:= Timing[Do[newDateDiff[{2011, 1, 19}, {2011, 1, 18}], {1000}];]
Out[15]= {0.015600, Null}