Advertisements
how to calculate milliseconds to hh mm ss ? Actually i wanted to calculate week days and hours from milliseconds..?
var seconds = (mil / 1000) | 0; mil -= seconds * 1000; var minutes = (seconds / 60) | 0; seconds -= minutes * 60; var hours = (minutes / 60) | 0; minutes -= hours * 60; var days = (hours / 24) | 0; hours -= days * 24; var weeks = (days / 7) | 0; days -= weeks * 7;