{"id":1528,"date":"2024-12-01T05:11:04","date_gmt":"2024-12-01T05:11:04","guid":{"rendered":"https:\/\/donhit.com\/en\/?p=1528"},"modified":"2025-02-07T09:35:44","modified_gmt":"2025-02-07T09:35:44","slug":"divide","status":"publish","type":"post","link":"https:\/\/donhit.com\/en\/time-calculators\/divide\/","title":{"rendered":"Divide Time Calculator"},"content":{"rendered":"<p><center> <div class=\"bg-white w-full max-w-md rounded-xl custom-shadow p-6\">\r\n        <h2 class=\"text-2xl font-bold text-center text-gray-800 mb-6\">\r\n            <i class=\"fas fa-clock mr-2 text-blue-500\"><\/i>Divide Time Calculator\r\n        <\/h2>\r\n        \r\n        <div class=\"space-y-4\">\r\n            <div>\r\n                <label for=\"totalTime\" class=\"block text-sm font-medium text-gray-700 mb-1\">Total Time (minutes)<\/label>\r\n                <input \r\n                    type=\"number\" \r\n                    id=\"totalTime\" \r\n                    class=\"w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500\"\r\n                    placeholder=\"Enter total time\"\r\n                >\r\n            <\/div>\r\n            \r\n            <div>\r\n                <label for=\"divideBy\" class=\"block text-sm font-medium text-gray-700 mb-1\">Divide By (number of parts)<\/label>\r\n                <input \r\n                    type=\"number\" \r\n                    id=\"divideBy\" \r\n                    class=\"w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500\"\r\n                    placeholder=\"Number of parts\"\r\n                >\r\n            <\/div>\r\n            \r\n            <div class=\"flex space-x-2\">\r\n                <select \r\n                    id=\"timeFormat\" \r\n                    class=\"w-1\/2 px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500\"\r\n                >\r\n                    <option value=\"minutes\">Minutes<\/option>\r\n                    <option value=\"hours\">Hours:Minutes<\/option>\r\n                <\/select>\r\n                \r\n                <select \r\n                    id=\"roundingType\" \r\n                    class=\"w-1\/2 px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500\"\r\n                >\r\n                    <option value=\"round\">Round<\/option>\r\n                    <option value=\"floor\">Floor<\/option>\r\n                    <option value=\"ceil\">Ceiling<\/option>\r\n                <\/select>\r\n            <\/div>\r\n            \r\n            <button \r\n                id=\"calculateBtn\" \r\n                class=\"w-full bg-blue-500 text-white py-2 rounded-md hover:bg-blue-600 transition duration-300 flex items-center justify-center\"\r\n            >\r\n                <i class=\"fas fa-calculator mr-2\"><\/i>Calculate\r\n            <\/button>\r\n        <\/div>\r\n        \r\n        <div \r\n            id=\"resultContainer\" \r\n            class=\"mt-6 bg-blue-50 p-4 rounded-md hidden\"\r\n        >\r\n            <h2 class=\"text-lg font-semibold text-gray-800 mb-2\">\r\n                <i class=\"fas fa-chart-pie mr-2 text-blue-500\"><\/i>Results\r\n            <\/h2>\r\n            <div id=\"resultDetails\" class=\"space-y-2\"><\/div>\r\n        <\/div>\r\n    <\/div>\r\n\r\n    <script>\r\n        document.addEventListener('DOMContentLoaded', () => {\r\n            const totalTimeInput = document.getElementById('totalTime');\r\n            const divideByInput = document.getElementById('divideBy');\r\n            const timeFormatSelect = document.getElementById('timeFormat');\r\n            const roundingTypeSelect = document.getElementById('roundingType');\r\n            const calculateBtn = document.getElementById('calculateBtn');\r\n            const resultContainer = document.getElementById('resultContainer');\r\n            const resultDetails = document.getElementById('resultDetails');\r\n\r\n            calculateBtn.addEventListener('click', calculateDividedTime);\r\n\r\n            function calculateDividedTime() {\r\n                \/\/ Validate inputs\r\n                const totalTime = parseFloat(totalTimeInput.value);\r\n                const divideBy = parseInt(divideByInput.value);\r\n                \r\n                if (isNaN(totalTime) || isNaN(divideBy) || divideBy <= 0) {\r\n                    alert('Please enter valid numbers. Divide by must be greater than 0.');\r\n                    return;\r\n                }\r\n\r\n                \/\/ Perform calculation\r\n                const timePerPart = calculateTime(totalTime, divideBy);\r\n\r\n                \/\/ Display results\r\n                displayResults(timePerPart);\r\n            }\r\n\r\n            function calculateTime(totalTime, divideBy) {\r\n                const timePerPart = totalTime \/ divideBy;\r\n                const roundingType = roundingTypeSelect.value;\r\n                const timeFormat = timeFormatSelect.value;\r\n\r\n                let roundedTime;\r\n                switch(roundingType) {\r\n                    case 'round':\r\n                        roundedTime = Math.round(timePerPart);\r\n                        break;\r\n                    case 'floor':\r\n                        roundedTime = Math.floor(timePerPart);\r\n                        break;\r\n                    case 'ceil':\r\n                        roundedTime = Math.ceil(timePerPart);\r\n                        break;\r\n                }\r\n\r\n                return {\r\n                    raw: timePerPart,\r\n                    rounded: roundedTime,\r\n                    format: timeFormat\r\n                };\r\n            }\r\n\r\n            function displayResults(timePerPart) {\r\n                \/\/ Clear previous results\r\n                resultDetails.innerHTML = '';\r\n                resultContainer.classList.remove('hidden');\r\n\r\n                \/\/ Format time based on selected option\r\n                let formattedTime;\r\n                if (timePerPart.format === 'hours') {\r\n                    const hours = Math.floor(timePerPart.rounded \/ 60);\r\n                    const minutes = timePerPart.rounded % 60;\r\n                    formattedTime = `${hours}h ${minutes}m`;\r\n                } else {\r\n                    formattedTime = `${timePerPart.rounded} minutes`;\r\n                }\r\n\r\n                \/\/ Create result details\r\n                const resultHTML = `\r\n                    <div class=\"flex justify-between\">\r\n                        <span class=\"font-medium text-gray-700\">Total Time:<\/span>\r\n                        <span class=\"text-blue-600\">${totalTimeInput.value} minutes<\/span>\r\n                    <\/div>\r\n                    <div class=\"flex justify-between\">\r\n                        <span class=\"font-medium text-gray-700\">Divided By:<\/span>\r\n                        <span class=\"text-blue-600\">${divideByInput.value} parts<\/span>\r\n                    <\/div>\r\n                    <div class=\"flex justify-between\">\r\n                        <span class=\"font-medium text-gray-700\">Time per Part:<\/span>\r\n                        <span class=\"text-green-600\">${formattedTime}<\/span>\r\n                    <\/div>\r\n                    <div class=\"flex justify-between\">\r\n                        <span class=\"font-medium text-gray-700\">Exact Time:<\/span>\r\n                        <span class=\"text-gray-500\">${timePerPart.raw.toFixed(2)} minutes<\/span>\r\n                    <\/div>\r\n                `;\r\n\r\n                resultDetails.innerHTML = resultHTML;\r\n            }\r\n\r\n            \/\/ Add keyboard support\r\n            [totalTimeInput, divideByInput].forEach(input => {\r\n                input.addEventListener('keypress', (e) => {\r\n                    if (e.key === 'Enter') {\r\n                        calculateDividedTime();\r\n                    }\r\n                });\r\n            });\r\n        });\r\n    <\/script><\/center><\/p>\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[185],"tags":[],"class_list":["post-1528","post","type-post","status-publish","format-standard","hentry","category-time-calculators"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.0 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Divide Time Calculator - DonHit<\/title>\n<meta name=\"description\" content=\"A Divide Time Calculator tool is a specialized utility designed to simplify the process of breaking down a given time period into manageable segments\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/donhit.com\/en\/time-calculators\/divide\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Divide Time Calculator - DonHit\" \/>\n<meta property=\"og:description\" content=\"A Divide Time Calculator tool is a specialized utility designed to simplify the process of breaking down a given time period into manageable segments\" \/>\n<meta property=\"og:url\" content=\"https:\/\/donhit.com\/en\/time-calculators\/divide\/\" \/>\n<meta property=\"og:site_name\" content=\"DonHit - World of Tools\" \/>\n<meta property=\"article:published_time\" content=\"2024-12-01T05:11:04+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-02-07T09:35:44+00:00\" \/>\n<meta name=\"author\" content=\"DonHit\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"DonHit\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Divide Time Calculator - DonHit","description":"A Divide Time Calculator tool is a specialized utility designed to simplify the process of breaking down a given time period into manageable segments","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/donhit.com\/en\/time-calculators\/divide\/","og_locale":"en_US","og_type":"article","og_title":"Divide Time Calculator - DonHit","og_description":"A Divide Time Calculator tool is a specialized utility designed to simplify the process of breaking down a given time period into manageable segments","og_url":"https:\/\/donhit.com\/en\/time-calculators\/divide\/","og_site_name":"DonHit - World of Tools","article_published_time":"2024-12-01T05:11:04+00:00","article_modified_time":"2025-02-07T09:35:44+00:00","author":"DonHit","twitter_card":"summary_large_image","twitter_misc":{"Written by":"DonHit","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/donhit.com\/en\/time-calculators\/divide\/#article","isPartOf":{"@id":"https:\/\/donhit.com\/en\/time-calculators\/divide\/"},"author":{"name":"DonHit","@id":"https:\/\/donhit.com\/en\/#\/schema\/person\/0c6ff7dcd8ba4810c56a532f09c33148"},"headline":"Divide Time Calculator","datePublished":"2024-12-01T05:11:04+00:00","dateModified":"2025-02-07T09:35:44+00:00","mainEntityOfPage":{"@id":"https:\/\/donhit.com\/en\/time-calculators\/divide\/"},"wordCount":7,"commentCount":0,"publisher":{"@id":"https:\/\/donhit.com\/en\/#\/schema\/person\/0c6ff7dcd8ba4810c56a532f09c33148"},"articleSection":["Time Calculators"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/donhit.com\/en\/time-calculators\/divide\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/donhit.com\/en\/time-calculators\/divide\/","url":"https:\/\/donhit.com\/en\/time-calculators\/divide\/","name":"Divide Time Calculator - DonHit","isPartOf":{"@id":"https:\/\/donhit.com\/en\/#website"},"datePublished":"2024-12-01T05:11:04+00:00","dateModified":"2025-02-07T09:35:44+00:00","description":"A Divide Time Calculator tool is a specialized utility designed to simplify the process of breaking down a given time period into manageable segments","breadcrumb":{"@id":"https:\/\/donhit.com\/en\/time-calculators\/divide\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/donhit.com\/en\/time-calculators\/divide\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/donhit.com\/en\/time-calculators\/divide\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Trang ch\u1ee7","item":"https:\/\/donhit.com\/en\/"},{"@type":"ListItem","position":2,"name":"Time Calculators","item":"https:\/\/donhit.com\/en\/category\/time-calculators\/"},{"@type":"ListItem","position":3,"name":"Divide Time Calculator"}]},{"@type":"WebSite","@id":"https:\/\/donhit.com\/en\/#website","url":"https:\/\/donhit.com\/en\/","name":"DonHit - World of tools","description":"","publisher":{"@id":"https:\/\/donhit.com\/en\/#\/schema\/person\/0c6ff7dcd8ba4810c56a532f09c33148"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/donhit.com\/en\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/donhit.com\/en\/#\/schema\/person\/0c6ff7dcd8ba4810c56a532f09c33148","name":"DonHit","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/donhit.com\/en\/#\/schema\/person\/image\/","url":"https:\/\/donhit.com\/en\/wp-content\/uploads\/2024\/11\/logo-donhit.webp","contentUrl":"https:\/\/donhit.com\/en\/wp-content\/uploads\/2024\/11\/logo-donhit.webp","width":400,"height":267,"caption":"DonHit"},"logo":{"@id":"https:\/\/donhit.com\/en\/#\/schema\/person\/image\/"},"description":"DonHit is a website designed to provide useful tools for everyone. Its primary goal is to support and empower the community. All the tools available on the site are completely free to use.","sameAs":["https:\/\/donhit.com\/en"],"url":"https:\/\/donhit.com\/en\/author\/admin_don\/"}]}},"_links":{"self":[{"href":"https:\/\/donhit.com\/en\/wp-json\/wp\/v2\/posts\/1528","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/donhit.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/donhit.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/donhit.com\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/donhit.com\/en\/wp-json\/wp\/v2\/comments?post=1528"}],"version-history":[{"count":4,"href":"https:\/\/donhit.com\/en\/wp-json\/wp\/v2\/posts\/1528\/revisions"}],"predecessor-version":[{"id":2216,"href":"https:\/\/donhit.com\/en\/wp-json\/wp\/v2\/posts\/1528\/revisions\/2216"}],"wp:attachment":[{"href":"https:\/\/donhit.com\/en\/wp-json\/wp\/v2\/media?parent=1528"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/donhit.com\/en\/wp-json\/wp\/v2\/categories?post=1528"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/donhit.com\/en\/wp-json\/wp\/v2\/tags?post=1528"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}