This discussion is archived
5 Replies Latest reply: Jan 18, 2013 6:16 AM by shreevat RSS

Calculation issues with date and time - Urgent

571912 Newbie
Currently Being Moderated
Hi,
I have to calculate the time difference between two dates with time stamps.

startTime = 17-01-2013 09:13:45 ;

endTime = 17-01-2013 09:13:46 ;

long finalTime = ( startTime - endTime) / 1000;

Above finalTime is not giving accurate time in seconds. it differs by 1 sec. For the above it should be 1 sec difference but giving valuse as zero. How to get the accurate time ? pl suggest.

I need finalTime in seconds.

Thanks,

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points