HomeUnit Conversion › Time Converter

Time Converter

Converts durations between nanoseconds, microseconds, milliseconds, seconds, minutes, hours, days, weeks, fortnights, 30-day months, 365-day years and Julian years (365.25 days).

When to use

You need a duration in another unit, e.g. hours to minutes, days to weeks or seconds to milliseconds.

Do not use when: You need the time between two calendar dates (use date-difference), a date shifted by a duration (use add-days), or a clock-time difference (use time-duration).

Formula

result = value × factor, factor = (1 from_unit in s) / (1 to_unit in s)

Calendar units are fixed averages: month_30 = 30 days, year_365 = 365 days, year_julian = 365.25 days; real calendar months (28–31 days) and leap years need a date calculator.

Inputs

ParameterTypeUnitRequiredDescription
valuenumberyesAmount to convert, expressed in from_unit.
from_unitenum: ns | us | ms | s | min | h | day | week | fortnight | month_30 | year_365 | year_julianyesUnit of the input value. Accepted symbols: ns, us, ms, s, min, h, day, week, fortnight, month_30, year_365, year_julian; spelled-out names and common abbreviations are accepted too.
to_unitenum: ns | us | ms | s | min | h | day | week | fortnight | month_30 | year_365 | year_julianyesUnit to convert into (same symbols as from_unit).

Outputs

OutputTypeUnitDescription
resultnumberConverted value expressed in to_unit (rounded to 6 decimals; see result_text for very small or very large values).
result_textstringThe conversion as text with 6 significant figures, e.g. "5 mi = 8.04672 km".
formulastringRelation used, e.g. "1 mi = 1.609344 km".
factornumberMultiplier from from_unit to to_unit (result = value × factor); absent for non-linear conversions.
conversion_tableobjectThe input value expressed in every supported time unit (6 significant figures), keyed by unit symbol.

Example

3 hours to minutes: {"value":3,"from_unit":"h","to_unit":"min"}{"result":180,"factor":60,"formula":"1 h = 60 min","conversion_table":{"s":10800,"day":0.125}}

90 days to weeks: {"value":90,"from_unit":"day","to_unit":"week"}{"result":12.857143,"conversion_table":{"h":2160,"month_30":3,"year_365":0.246575}}

GET https://tttkmbb.com/api/v1/calculate/time?value=3&from_unit=h&to_unit=min

Machine access

Sources

FAQ

How long is a month or a year here?

month_30 is exactly 30 days and year_365 exactly 365 days (year_julian is 365.25 days, the astronomical convention). For real calendar arithmetic use date-difference or add-days.

Does 'day' account for daylight-saving changes?

No. A day is exactly 86,400 s; clock changes and leap seconds are ignored.

Related calculators