{
    "name": "Time Duration Calculator",
    "url": "https://calculators.geekmidst.com/calculators/time-duration-calculator",
    "markdown": "https://calculators.geekmidst.com/calculators/time-duration-calculator.md",
    "category": "Date, time & lifestyle",
    "description": "Find the time between two clock times, including overnight spans, or between two dates and times, in days, hours, minutes and decimal hours.",
    "summary": "Enter a start and an end time to get the elapsed time. If the end time is earlier than the start and no dates are given, it is taken as the next day, as for a night shift.",
    "also_called": [
        "Elapsed time calculator",
        "Hours between times calculator"
    ],
    "applies_to": "Worldwide",
    "last_updated": "2026-10-29",
    "computation": "Results are computed in the visitor’s browser on the HTML page. This API describes the calculator; it does not compute results.",
    "inputs": [
        {
            "name": "start_date",
            "label": "Start date (optional)",
            "type": "date",
            "default": "",
            "optional": true
        },
        {
            "name": "start_time",
            "label": "Start time",
            "type": "time",
            "default": "09:15"
        },
        {
            "name": "end_date",
            "label": "End date (optional)",
            "type": "date",
            "default": "",
            "optional": true
        },
        {
            "name": "end_time",
            "label": "End time",
            "type": "time",
            "default": "17:45"
        }
    ],
    "outputs": [
        {
            "key": "duration",
            "label": "Duration",
            "format": "text"
        },
        {
            "key": "total_hours",
            "label": "In decimal hours",
            "format": "number"
        },
        {
            "key": "total_minutes",
            "label": "In minutes",
            "format": "number"
        },
        {
            "key": "total_seconds",
            "label": "In seconds",
            "format": "integer"
        },
        {
            "key": "hhmm",
            "label": "As hh:mm",
            "format": "text"
        }
    ],
    "formula": {
        "text": "Duration = (End date − Start date) × 24 h + (End time − Start time);  without dates, add 24 h when the end time is earlier than the start;  Decimal hours = Hours + Minutes ÷ 60",
        "variables": {
            "Dates": "calendar dates; leap days are counted",
            "Times": "24-hour clock times"
        }
    },
    "worked_example": {
        "inputs": {
            "start_date": "",
            "start_time": "09:15",
            "end_date": "",
            "end_time": "17:45"
        },
        "steps": [
            "17:45 − 09:15 = 8 hours and 30 minutes.",
            "Decimal hours = 8 + 30 ÷ 60 = 8.5.",
            "In minutes: 8 × 60 + 30 = 510."
        ],
        "result": "From 9:15 to 17:45 is 8 hours 30 minutes, or 8.5 hours."
    },
    "interpretation": "Decimal hours are what timesheets and payroll multiply by an hourly rate: 8 h 30 min is 8.5 hours, not 8.30.",
    "assumptions": [
        "Clock times are in the same time zone."
    ],
    "limitations": [
        "Daylight-saving changes are not applied: a span across a clock change will be an hour off.",
        "Breaks are not deducted."
    ],
    "rules": null,
    "faqs": [
        {
            "question": "How do I convert minutes to decimal hours?",
            "answer": "Divide by 60. 15 min = 0.25 h, 30 min = 0.5 h, 45 min = 0.75 h."
        },
        {
            "question": "How do I time a night shift?",
            "answer": "Enter the start and end times with no dates. If the end is earlier than the start, it is counted as the next morning: 22:30 to 06:15 is 7 h 45 min."
        }
    ],
    "sources": [],
    "related": [
        {
            "name": "Date Difference Calculator",
            "url": "https://calculators.geekmidst.com/calculators/date-difference-calculator"
        },
        {
            "name": "Day of the Week Calculator",
            "url": "https://calculators.geekmidst.com/calculators/day-of-the-week-calculator"
        },
        {
            "name": "Age Calculator",
            "url": "https://calculators.geekmidst.com/calculators/age-calculator"
        },
        {
            "name": "Sleep Calculator",
            "url": "https://calculators.geekmidst.com/calculators/sleep-calculator"
        }
    ],
    "disclaimer": null,
    "publisher": "GM¹X CalcVerse"
}