Click here to Skip to main content
15,747,637 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I want to calculate difference between 2 date in terms of year,month,days,week.
How can I do this??
Posted
Updated 19-Jun-15 5:13am
v2
Comments
PIEBALDconsult 19-Jun-15 12:00pm    
Ask your dates how old they are and then compare.

1 solution

While it says .NET 2003, it still applies to the current version:
Code: Determining the Span Between Two Dates (Visual C#)[^]
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 19-Jun-15 11:13am    
My 5, but just saying "use the - operator" would suffice. :-)
—SA
Maciej Los 19-Jun-15 11:17am    
Agree with Sergey. +5!

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