how to calculate time difference in c#
hi,
I am doing one attendance project using RFID Card. I am using c# windows application. Now I want to know how to calculate time difference between yesterday's time and today's time.
I want to get yesterday's time(time) from database and get today's time from system time(currenttime).
I use this coding,
double duration = (currenttime).Subtract(time).TotalSeconds;
This coding calculate total difference in seconds with negative value...
Please help...
thanks in advance.....