Home page Misc index page Find your lat and long Link budget from Alpha Centauri dB calculator Focal length calculator Flight navigation computer Delta V orbit injection calculator SETI range calculator Antenna gain and Beamwidth calculator Deg, min, sec calculator

Calculator to work out Days, Hours, Minutes, Seconds using Sec as input

The purpose of this page is to allow you to calculator the number of Days, Hours, Minutes, Seconds in a large number of seconds.

Enter the number of seconds in the light grey box below (by modifying the default value shown) and then click the calculate button to obtain results in the green boxes.

 Input Total Seconds s Days d Hours h Minutes m Seconds s

If you want to know how this calculator works have a look at the html and javascript code which is embedded in the text html code of this page. Do something like this: "Right mouse click on this page", then do "View Page Source". The javascript code is also shown below:

function computeform(form) {

var totalseconds;

var day = 86400;
var hour = 3600;
var minute = 60;

var totalseconds = form.totalseconds.value;

var daysout = Math.floor(totalseconds / day);
var hoursout = Math.floor((totalseconds - daysout * day)/hour);
var minutesout = Math.floor((totalseconds - daysout * day - hoursout * hour)/minute);
var secondsout = totalseconds - daysout * day - hoursout * hour - minutesout * minute;

form.daysout.value = daysout;
form.hoursout.value = hoursout;
form.minutesout.value = minutesout;
form.secondsout.value = secondsout;
return;
}

Have fun and good luck.   I thought about including a 'year' output and wondered how long was a year. Maybe 365.2422 days, but I thought that that might confuse people.  Similarly one day has been set to 86400 seconds exactly, rather than 23 hours 56 minutes 4.091 seconds which is the sidereal average.