A
Ali Baba
Hi,
Is there is equivalent of VB's DateDiff() method in C#. I need to find
difference in months between two dates that are years apart. Docs says
that I can use TimeSpan like:
TimeSpam ts = date1 - date2;
but this gives me data in Days. I don't want to divide this number by 30
because not every month is 30 days and since the two operand values are
quite apart from each other, I am afraid dividing by 30 might give me a
wrong value.
Any suggestions???
Is there is equivalent of VB's DateDiff() method in C#. I need to find
difference in months between two dates that are years apart. Docs says
that I can use TimeSpan like:
TimeSpam ts = date1 - date2;
but this gives me data in Days. I don't want to divide this number by 30
because not every month is 30 days and since the two operand values are
quite apart from each other, I am afraid dividing by 30 might give me a
wrong value.
Any suggestions???