Time Units Converter
Convert between Seconds, Minutes, Hours, and Years instantly with scientific precision.
Common Use Cases
Development
Convert timeout values from seconds to milliseconds (e.g. 5s = 5000ms) for JavaScript functions.
Video Editing
Calculate total runtime frames or convert "90 minutes" into seconds for ffmpeg commands.
Planning
Convert project estimates from "hours" to "work weeks" instantly (e.g. 120 hours = 3 weeks).
Sports
Convert marathon times or lap splits into total seconds for easier comparison and graphing.
How to Use
- Enter Value: Type the amount of time you want to convert (e.g.,
90). - Select Unit: Choose the starting unit from the dropdown (e.g.,
Minutes). - Get Results: The tool instantly calculates the equivalent duration in all other units, from milliseconds to centuries.
- Copy: Click the copy icon on any card to use the result in your code or documents.
Time Conversion in Code
Converting time units is a common task in programming. Here is how to convert Seconds to Formatted Time in different languages.
function formatTime(seconds) {
const h = Math.floor(seconds / 3600);
const m = Math.floor((seconds % 3600) / 60);
const s = seconds % 60;
return `${h}h ${m}m ${s}s`;
}
console.log(formatTime(3665));
// Output: "1h 1m 5s"import datetime
seconds = 3665
time_str = str(datetime.timedelta(seconds=seconds))
print(time_str)
# Output: "1:01:05"$seconds = 3665;
echo gmdate("H:i:s", $seconds);
// Output: "01:01:05"package main
import (
"fmt"
"time"
)
func main() {
seconds := 3665
d := time.Duration(seconds) * time.Second
fmt.Println(d.String())
// Output: "1h1m5s"
}Frequently Asked Questions
How many days are in a year?
In scientific and astronomical contexts (Julian year), a year is calculated as 365.25 days to account for leap years. This tool uses this exact value for precision.
How many seconds in a day?
There are exactly 86,400 seconds in a standard day (60 seconds ร 60 minutes ร 24 hours).
Microseconds vs Milliseconds?
A millisecond (ms) is 1/1000th of a second. A microsecond (ยตs) is 1/1,000,000th of a second. Microseconds are 1000x smaller than milliseconds.
What is a decade?
A decade is a period of 10 years. A century is 100 years. A millennium is 1000 years.