Time Converter
Convert any duration โ from milliseconds to years โ in a single step. Whether you're setting a cache expiry in code, planning a project sprint, or just curious how many seconds are in a year, get the answer instantly.
What This Tool Does
The conversion
Enter a duration in any supported unit and the converter instantly recalculates it in all others simultaneously. Fixed units (seconds, minutes, hours, days, weeks) use exact integer relationships. For months and years, the tool applies the standard Gregorian average of 365.25 days per year โ the same value used by most databases, APIs, and programming languages.
Who uses it
- Developers setting cache TTLs, JWT expiry, or rate-limit windows in seconds or milliseconds
- Project managers converting sprint estimates between hours and working days
- Students solving physics or chemistry problems that require SI time units
- HR & payroll translating contracted hours into fractional days or weeks
- Content creators checking total runtime across a video series or podcast feed
Understanding the Units
Second (s)
The SI base unit of time. Defined by atomic clocks as exactly 9,192,631,770 oscillations of a caesium-133 atom. Every other unit in this converter is derived from it.
Minute (min)
Exactly 60 seconds. The most common unit for everyday scheduling, cooking timers, and meeting lengths.
Hour (h)
Exactly 3,600 seconds (60 ร 60). Standard unit for work hours, travel time, and most human planning.
Day (d)
Exactly 86,400 seconds (24 ร 3,600). Based on Earth's solar rotation. Used in project timelines, TTLs, and billing cycles.
Week (wk)
Exactly 7 days or 604,800 seconds. The most common sprint and billing period unit in project management.
Month / Year
These are approximations: 1 year = 365.25 days (Gregorian average), 1 month = 365.25 รท 12 โ 30.44 days. Results are averages, not tied to a specific calendar month.
Worked Examples
Practical conversions from real situations โ verify each one using the tool above.
You want to set a Redis cache key to expire in 2 days.
โ 2 days = 172,800 seconds. Pass 172800 to EXPIRE or use 172,800,000 ms if your client expects milliseconds.
A project estimate says a task will take 90 hours. How many working days is that?
โ At 8 hours per day: 90 รท 8 = 11.25 working days โ just over two standard working weeks.
A JWT token needs to expire after 30 days. What is that in seconds?
โ 30 ร 86,400 = 2,592,000 seconds. This is the value to pass to most auth libraries as exp.
A podcast season runs 18 episodes averaging 42 minutes each. What is the total in hours?
โ 18 ร 42 = 756 minutes รท 60 = 12.6 hours of content.
A physics problem asks: convert 2.5 ร 10โถ seconds into days.
โ 2,500,000 รท 86,400 โ 28.94 days โ just under one calendar month.
Quick Reference: Unit Relationships
Exact values where the relationship is fixed; averages noted where calendar ambiguity applies.
| Unit | Seconds | Minutes | Hours | Days |
|---|---|---|---|---|
| 1 minute | 60 | 1 | 0.0167 | 0.000694 |
| 1 hour | 3,600 | 60 | 1 | 0.0417 |
| 1 day | 86,400 | 1,440 | 24 | 1 |
| 1 week | 604,800 | 10,080 | 168 | 7 |
| 1 month (avg) | 2,629,800 | 43,830 | 730.5 | 30.44 |
| 1 year (common) | 31,536,000 | 525,600 | 8,760 | 365 |
Developer Quick Reference
Common TTL, expiry, and rate-limit durations in seconds and milliseconds โ ready to paste into your code.
| Use case | Milliseconds | Seconds |
|---|---|---|
| 1 hour cache TTL | 3,600,000 | 3,600 |
| 24 hour JWT expiry | 86,400,000 | 86,400 |
| 7-day session token | 604,800,000 | 604,800 |
| 30-day refresh token | 2,592,000,000 | 2,592,000 |
| Rate limit window (1 min) | 60,000 | 60 |
* Month-based values use exact 30-day months; adjust if your contract specifies calendar months.
Real-World Duration Reference
Familiar durations as context for your conversions.
| Duration | Seconds | Notes |
|---|---|---|
| Average human heartbeat | ~1 | 60โ100 BPM at rest |
| One TV episode (drama) | 2,700โ3,600 | 45โ60 min |
| Feature film | 5,400โ9,000 | 90โ150 min |
| Standard workday | 28,800 | 8 hours |
| 40-hour work week | 144,000 | 5 ร 8 hr days |
| One calendar month (avg) | 2,629,800 | โ 730.5 hours |
| One year | 31,536,000 | 365 ร 86,400 s |
| Human lifespan (80 years) | ~2,524,608,000 | โ 2.5 billion seconds |
Tips & Limitations
๐ก Tips for best results
- Decimals work fine: Enter
1.5hours to get 90 minutes, 5,400 seconds, etc. โ no rounding applied. - For developer use: The seconds output is the value to pass to most back-end expiry functions. Multiply by 1,000 for millisecond-based libraries like Node.js
setTimeout. - Working days vs calendar days: This tool converts calendar days (24 h each). For working-day estimates, divide your hour total by your team's contracted daily hours (typically 7.5 or 8).
- Large numbers: The converter handles very large inputs (e.g. millions of seconds) without overflow โ useful for astronomy, geology, or long-running systems.
โ ๏ธ Limitations to know
- Months and years are averages: Because calendar months range from 28 to 31 days, conversions involving months or years are approximations based on the Gregorian average. For exact date arithmetic, use a date library like
date-fnsorTemporal. - Leap seconds not included: The tool does not account for leap seconds added by IERS. For precision timekeeping in scientific or financial contexts, consult an NTP or TAI-aware library.
- Timezone-unaware: This is a pure duration converter. It does not account for daylight saving transitions, which can make a "day" 23 or 25 hours in wall-clock time.
Frequently Asked Questions
How many seconds are in a year?
A common (non-leap) year has 365 ร 86,400 = 31,536,000 seconds. A leap year adds one day: 366 ร 86,400 = 31,622,400 seconds. The Gregorian average (365.25 days) gives 31,557,600 seconds โ the value most software uses when storing durations.
Why does the tool use 30.44 days for a month instead of 30?
Using a flat 30 days per month would undercount by about 5.4 days per year. The tool instead uses 365.25 รท 12 โ 30.4375 days, which correctly averages across the 4-year leap cycle. This matches the convention used by most programming languages, databases, and standards bodies.
How do developers use time unit conversions?
The most common need is converting human-readable durations ("expire in 7 days") into the seconds or milliseconds that APIs and libraries expect. Examples: Redis EXPIRE, JWT exp claims, HTTP Cache-Control max-age, Node.js setTimeout, cron intervals. The developer reference table on this page lists the most common values pre-calculated.
What is the difference between a Julian year and a Gregorian year?
A Julian year is exactly 365.25 days (31,557,600 seconds) โ used in astronomy and light-year calculations. The Gregorian civil year averages 365.2425 days, accounting for the century-year rule (years divisible by 100 are not leap years, unless also divisible by 400). The difference accumulates to about 3 days over 10,000 years.
Can I convert milliseconds here?
If the tool includes a milliseconds field, enter your value directly. Otherwise, divide your millisecond count by 1,000 to get seconds, then enter that in the seconds field โ all other outputs will update instantly.
Does this tool store my data?
No. Every calculation happens locally in your browser. Nothing you type is sent to a server or recorded in any log.
How the Converter Works
All conversions pass through seconds as the internal base unit. When you enter a value, it is first converted to seconds using an exact factor, then fanned out to every other unit in a single pass. This prevents rounding errors that would compound if units were converted in a chain (e.g. years โ months โ weeks โ days).
Fixed relationships (second โ minute โ hour โ day โ week) are exact integers. Month and year conversions use the Gregorian average: 1 year = 365.25 days, 1 month = 365.25/12 days. All arithmetic runs in JavaScript's IEEE 754 double-precision (64-bit) floating point, giving at least 15 significant figures of accuracy โ well beyond any practical need.