Pular para o conteúdo

Calculadora de duração

Quantas horas, minutos ou segundos entre dois horários - ou duas datas - no seu navegador.

Roda no seu navegador

Dois seletores: início e fim. Calculamos a duração em três formas - HH:MM:SS, segundos totais, e uma decomposição 'X dias Y horas Z minutos'. Meia-noite, fronteira de dia, DST.

Intervalo inválido

Como usar

  1. Pick the start and end

    Date + time pickers for both. Default is the current moment for both, edit to suit.

  2. Pick the breakdown style

    HH:MM:SS, total seconds, or natural language.

  3. Copy the result

    All three breakdowns are shown; copy the one you need.

O que é?

A duration calculator is a stopwatch you can wind backwards: tell it when something started and when it ended, get the elapsed time. The arithmetic is trivial once both endpoints are normalised to a UTC millisecond timestamp; the user-facing complication is the breakdown - hours, minutes, seconds, days, optionally business hours - and the parsing of the input picker.

Quando usar

Working out billable hours from a timesheet's clock-in and clock-out columns. Comparing two shift lengths to spot the longer one. Verifying that an SLA window (9 a.m. to 5 p.m. business hours) was met. Counting the elapsed time of a flight, a meeting or a cooking session.

Erros comuns

Forgetting that the 'end before start' case happens (use absolute value or assume the user typoed). Mixing up 'business hours' with 'wall-clock hours' for events that cross overnight. And confusing 'minutes' (decimal minutes - 1.5 = 1m30s) with 'hours and minutes' notation.

FAQ

Does it handle daylight saving time?
Yes. JavaScript's Date handles DST internally, so a span that crosses a 'spring forward' is one hour shorter, and a 'fall back' is one hour longer - just like the real elapsed time.
How is 'business hours' computed?
We count whole hours within a configurable working window (default 09:00-17:00, Monday-Friday). Holidays aren't subtracted - that's a country-specific concept.

Mais nesta categoria