Calculate Number Of Days Between Two Dates

Just a very quick one today.

I recently needed to find the number of days between two dates. I thought this would be easy in Emacs, and indeed it was, but as with most things in Emacs, you need to know exactly what you’re doing. Here is the method I used:

  M-x =calendar=

  Navigate to the start date

  Set mark

  Navigate to the end date

  M-x =calendar-count-days-region=

  OR

  M-=

Note that the count is inclusive of the mark, the documentation says:

It is bound to M-=.

Count the number of days (inclusive) between point and the mark.

That is all. 🙂

Comments

comments powered by Disqus