{
    "name": "Time Calculator",
    "url": "https://calculators.geekmidst.com/calculators/time-calculator",
    "markdown": "https://calculators.geekmidst.com/calculators/time-calculator.md",
    "category": "Date, time & lifestyle",
    "description": "Add or subtract two durations given in days, hours, minutes and seconds, and see the answer in each unit and as decimal hours.",
    "summary": "Enter two lengths of time and add or subtract them. The answer is normalised, so 90 minutes becomes 1 hour 30 minutes, and is also given in decimal hours.",
    "also_called": [
        "Duration calculator",
        "Hours and minutes 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": "d1",
            "label": "First: days",
            "type": "number",
            "default": "1",
            "optional": true
        },
        {
            "name": "h1",
            "label": "First: hours",
            "type": "number",
            "default": "2",
            "optional": true
        },
        {
            "name": "m1",
            "label": "First: minutes",
            "type": "number",
            "default": "30",
            "optional": true
        },
        {
            "name": "s1",
            "label": "First: seconds",
            "type": "number",
            "default": "0",
            "optional": true
        },
        {
            "name": "operation",
            "label": "Operation",
            "type": "segmented",
            "default": "add",
            "options": {
                "add": "Add (+)",
                "subtract": "Subtract (−)"
            }
        },
        {
            "name": "d2",
            "label": "Second: days",
            "type": "number",
            "default": "0",
            "optional": true
        },
        {
            "name": "h2",
            "label": "Second: hours",
            "type": "number",
            "default": "23",
            "optional": true
        },
        {
            "name": "m2",
            "label": "Second: minutes",
            "type": "number",
            "default": "45",
            "optional": true
        },
        {
            "name": "s2",
            "label": "Second: seconds",
            "type": "number",
            "default": "30",
            "optional": true
        }
    ],
    "outputs": [
        {
            "key": "result",
            "label": "Result",
            "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": "number"
        }
    ],
    "formula": {
        "text": "Seconds = 86,400 × days + 3,600 × hours + 60 × minutes + seconds for each duration; add or subtract, then split back into days, hours, minutes and seconds.",
        "variables": {
            "86,400": "seconds in a day",
            "3,600": "seconds in an hour"
        }
    },
    "worked_example": {
        "inputs": {
            "d1": "1",
            "h1": "2",
            "m1": "30",
            "s1": "0",
            "operation": "add",
            "d2": "0",
            "h2": "23",
            "m2": "45",
            "s2": "30"
        },
        "steps": [
            "First: 86,400 + 7,200 + 1,800 = 95,400 s.",
            "Second: 82,800 + 2,700 + 30 = 85,530 s.",
            "Sum: 180,930 s = 2 days (172,800 s) + 2 h (7,200 s) + 15 min (900 s) + 30 s."
        ],
        "result": "1 day 2 h 30 min plus 23 h 45 min 30 s is 2 days 2 h 15 min 30 s, or about 50.26 hours."
    },
    "interpretation": "Decimal hours are what timesheets and invoices usually need: 15 minutes is 0.25 h, 30 minutes 0.5 h and 45 minutes 0.75 h. A negative result means the second duration is longer than the first.",
    "assumptions": [
        "A day is exactly 24 hours (durations, not calendar days across a daylight-saving change)."
    ],
    "limitations": [
        "To find the time between two clock times, use the Hours Calculator."
    ],
    "rules": null,
    "faqs": [
        {
            "question": "How do I convert minutes to decimal hours?",
            "answer": "Divide by 60. For example 45 minutes ÷ 60 = 0.75 hours, so 7 h 45 min is 7.75 hours."
        },
        {
            "question": "Can I enter 90 minutes?",
            "answer": "Yes. Any field can exceed its usual range; the result is normalised to 1 h 30 min."
        }
    ],
    "sources": [],
    "related": [
        {
            "name": "Hours Calculator",
            "url": "https://calculators.geekmidst.com/calculators/hours-calculator"
        },
        {
            "name": "Time Card Calculator",
            "url": "https://calculators.geekmidst.com/calculators/time-card-calculator"
        },
        {
            "name": "Date Calculator",
            "url": "https://calculators.geekmidst.com/calculators/date-calculator"
        }
    ],
    "disclaimer": null,
    "publisher": "GM¹X CalcVerse"
}