Aller au contenu

Calculateur de durée

Combien d'heures, minutes ou secondes entre deux heures - ou deux dates complètes - dans votre navigateur.

Fonctionne dans votre navigateur

Deux sélecteurs : début et fin. On calcule la durée et l'affiche en trois formes - HH:MM:SS, secondes totales, et un découpage 'X jours Y heures Z minutes'. Gère minuit, frontière de jour, DST.

Intervalle invalide

Comment l'utiliser

  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.

Qu'est-ce que c'est ?

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.

Quand l'utiliser

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.

Erreurs courantes

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.

Plus dans cette catégorie