Quantcast
Channel: Difference in months between two dates - Stack Overflow
Viewing all articles
Browse latest Browse all 48

Answer by Jean-David Lanz for Difference in months between two dates

$
0
0

Um, actually, the OP asked for something like VB's DateDiff(). It turns out that that function works very simply for months:

((LastDate.Year - FirstDate.Year) * 12) + LastDate.Month - FirstDate.Month

seems to emulate it perfectly.

(Unless I be mistaken. I'll welcome anyone pointing out a mistake.)


Viewing all articles
Browse latest Browse all 48

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>