Click here to Skip to main content
15,892,805 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
how to find month Number in Previous Date and Last Date.
then return of Next Date Month .
ex.. Previous Date is 30-5-2013 and Last Date is 02-01-2014
so Result is 8 Month then Next Date
is LastDate + 8 Month = ? return(Month and Year)
using C#
Posted
Updated 11-Mar-14 19:59pm
v4
Comments
CodingLover 12-Mar-14 1:47am    
You want to find the difference of two dates in months?

Can you clarify your question. From your question I think you want to find month difference between two dates. Is it correct?
Following post may be useful for you.
http://stackoverflow.com/questions/4638993/difference-in-months-between-two-dates[^]
 
Share this answer
 
Comments
mohit busa 12-Mar-14 2:00am    
then Find Next Date Of In Year
Ex://DateTime format MM/dd/yyyy
DateTime dtPrevious=new DateTime(2013,05,30);
DateTime dtLast=new DateTime(2014,01,02);
//Now you want Next Date should come after 8 months ahed of LastDate. Then your calculation shuould be
DateTime dtNext=dtLast.AddMonths(8);
 
Share this answer
 
Just take the two dates and then subtract the absolute months calculated from those two.
 
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