Click here to Skip to main content
15,881,898 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello,
I want to compare two dates and if the difference is one month to display a message box. I found the compare method but only shows if it is greater equal or less than, any ideas on how to count the difference of the dates in months?

Kyriakos
Posted

1 solution

Use the DateDiff[^] function.

As the first parameter use DateInterval.Month (or "m") to get the number of month between the two dates. If the result is 0 than the difference is less than a month.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900