Time Unit Conversion

Converts a duration into milliseconds, seconds, minutes, hours, days, weeks, months and years. Months and years use the Gregorian average: a year of 365.2425 days, and a month of a twelfth of that.

This converts a duration between milliseconds, seconds, minutes, hours, days, weeks, months and years. From minutes down it is a clean business of 60s and 24s.

1 min=60 s,1 h=3600 s,1 day=86400 s1\ \text{min} = 60\ \text{s}, \quad 1\ \text{h} = 3600\ \text{s}, \quad 1\ \text{day} = 86400\ \text{s}

Months and years only exist as averages

Calendar months run from 28 to 31 days, and leap years shift the year by a day. Months and years can therefore only be converted on average. The figures here use the Gregorian average: a year of 365.2425 days and a month of a twelfth of that. In seconds those come to 31556952 and 2629746, both exactly whole numbers.

Example

A day is 86400 seconds, 1440 minutes and 24 hours. It is 0.142857 of a week, 0.0329 of an average month and 0.00274 of a year. Turned around, a year is 8765.82 hours, a little short of ten thousand.

Where 365.2425 comes from

The Gregorian calendar adds a leap day every four years, skips it every hundred, and restores it every four hundred. That is 97 leap years in 400, giving an average of 365+97÷400=365.2425365 + 97 \div 400 = 365.2425 days.

Notes

To count the days in a particular stretch of time, use the calendar rather than these averages. A month spanning February and one spanning July differ by three days.