leathu raj

leathu raj

  • NA
  • 62
  • 77.9k

how to calculate time difference in c#

Jun 25 2014 1:00 AM
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.....
 

Answers (5)