Thursday 7 February 2013

Find total hours between two Dates

Leave a Comment

long secs = (this.endDate.getTime() - this.startDate.getTime()) / 1000;
int hours = secs / 3600;    
secs = secs % 3600;
int mins = secs / 60;
secs = secs % 60;

0 comments:

Post a Comment