Getting The Difference Between Months
-
Hi, Im trying to create a C# program that will compute the exact number of months between two durations. This is my code TimeSpan duration = startTime - stopTime; //to compute the difference between days, I use this code int result = (duration.Days); unfortunately it stops with duration.Days.. there are no available methods that will compute the months or years (eg. duration.Months , duration.Years) i tried to compute the days and divide it by 30, but this approach is highly innacurate. Hope you guys can help tnx
-
Hi, Im trying to create a C# program that will compute the exact number of months between two durations. This is my code TimeSpan duration = startTime - stopTime; //to compute the difference between days, I use this code int result = (duration.Days); unfortunately it stops with duration.Days.. there are no available methods that will compute the months or years (eg. duration.Months , duration.Years) i tried to compute the days and divide it by 30, but this approach is highly innacurate. Hope you guys can help tnx
Hi Check this link http://www.c-sharpcorner.com/UploadFile/DipalChoksi/DateDiff_CS_DC09132006172429PM/DateDiff_CS_DC.aspx[^]
Harini
-
Hi Check this link http://www.c-sharpcorner.com/UploadFile/DipalChoksi/DateDiff_CS_DC09132006172429PM/DateDiff_CS_DC.aspx[^]
Harini