{"id":45,"date":"2024-04-05T04:19:08","date_gmt":"2024-04-05T04:19:08","guid":{"rendered":"https:\/\/robocalculator.com\/?p=45"},"modified":"2024-04-05T05:04:51","modified_gmt":"2024-04-05T05:04:51","slug":"day-counter","status":"publish","type":"post","link":"https:\/\/robocalculator.com\/calculator\/day-counter\/","title":{"rendered":"Day Counter Calculator – Calculate Days Between Two Dates"},"content":{"rendered":"\n

Use this user-friendly day counter calculator<\/strong> to get the total number of days and an exact count of business days for any given period.<\/p>\n\n\n\n

To simplify things, the day counter calculator has easy-to-follow instructions that guide you through the process. Understanding the tool’s calendar and how to tally up the business days between dates will help you organize your schedule more effectively. <\/p>\n\n\n\n\n\n \n \n Date Difference Tool<\/title>\n <style>\n .inputBox {\n width: 100%;\n border: 2px solid black;\n margin: 3px;\n padding: 8px !important;\n padding-left: 10px !important;\n border-radius: 8px;\n font-size: 18px;\n background: white;\n cursor: pointer;\n}\n\n.MainBox {\n border: 2px solid black;\n border-radius: 13px;\n padding: 2%;\n}\n\n.mb-3 {\n margin-bottom: 1rem !important;\n}\n\n.mt-3 {\n margin-top: 1rem !important;\n}\n\n.mb-4 {\n margin-bottom: 1.5rem !important;\n}\n\n.mb-2 {\n margin-bottom: 0.5rem !important;\n}\n\n.mt-2 {\n margin-top: 0.5rem !important;\n}\n\n.mt-4 {\n margin-top: 1.5rem !important;\n}\n\n.btn {\n border: 2px solid black;\n background-color: white;\n color: black;\n padding: 10px 20px;\n font-size: 20px;\n border-radius: 8px;\n width: 90%;\n cursor: pointer;\n}\n\n.btn-outline-secondary {\n border-color: rgb(60, 64, 67);\n color: black;\n}\n\n.btn-outline-secondary:hover {\n background-color: rgb(60, 64, 67);\n color: white;\n}\n.btn-center{\n text-align: center;\n}\n\n.DivHeadings {\n font-size: 18px;\n margin: 3px;\n padding: 5px;\n font-weight: 700;\n padding-left: 2px;\n width: 28%;\n display: inline-block;\n text-align: end;\n}\n\n.Fields {\n width: 64%;\n display: inline-block;\n font-size: 20px;\n}\n\n#ResultSection {\n background-color: rgb(60, 64, 67);\n color: white;\n border: 2px solid rgb(60, 64, 67);\n border-radius: 10px;\n padding: 5px;\n}\n\n.ResultHeading{\n color: white;\n text-align: center;\n font-size: 28px;\n font-weight: 700;\n}\n\n.ResultContent{\n font-size: 20px;\n margin: 3px;\n padding: 5px;\n font-weight: 700;\n padding-left: 2px;\n width: 50%;\n display: inline-block;\n text-align: right;\n}\n\n.FieldsResult{\n font-size: 20px;\n width: 45%;\n display: inline-block;\n}\n\n.right{\n float: right;\n cursor: pointer;\n}\n\n.ResultValue{\n padding-left: 5%;\n}\n\n@media only screen and (max-width: 530px) {\n .MainBox {\n border: none;\n padding: 2%;\n }\n\n .DivHeadings {\n width: 100%;\n display: block;\n text-align: start;\n font-size: 19px;\n padding: 0px;\n }\n\n .Fields {\n width: 100%;\n display: block;\n }\n\n .dropdown-content {\n right: 0;\n left: 0;\n }\n\n .toggle-label {\n width: 47%;\n }\n\n .btn{\n width: 100%;\n }\n\n .ResultContent{\n width: 100%;\n text-align: center;\n }\n\n .FieldsResult{\n width: 100%;\n text-align: center;\n }\n\n .right{\n float: none;\n margin-left: 6px;\n }\n \n\n}\n <\/style>\n<\/head>\n\n<body>\n\n <div class=\"MainBox\">\n <div>\n <div class=\"DivHeadings\">\n Start Date\n <\/div>\n\n <div class=\"Fields\">\n <input type=\"date\" id=\"StartDate\" class=\"inputBox\">\n <\/div>\n <\/div>\n\n <div>\n <div class=\"DivHeadings\">\n End Date\n <\/div>\n\n <div class=\"Fields\">\n <input type=\"date\" id=\"EndDate\" class=\"inputBox\">\n <\/div>\n <\/div>\n\n <div>\n <div class=\"DivHeadings\">\n Include last day\n <\/div>\n\n <div class=\"Fields\">\n <input type=\"radio\" name=\"IncludeLastDay\" id=\"Yes\" value=\"Yes\" onchange=\"HideResultSection()\">\n <label for=\"Yes\">Yes<\/label>\n\n <input type=\"radio\" name=\"IncludeLastDay\" id=\"No\" value=\"No\" checked onchange=\"HideResultSection()\">\n <label for=\"No\">No<\/label>\n <\/div>\n <\/div>\n\n <div class=\"btn-center mt-3 mb-2\">\n <button onclick=\"Calculate()\" class=\"btn btn-outline-secondary\">Count Days<\/button>\n <\/div>\n\n <\/div>\n \n <div class=\"mt-4 mb-2 MainBox\" id=\"ResultSection\" style=\"display: none;\">\n\n <div class=\"ResultHeading mt-2\">\n Calculation Results\n <\/div>\n <div>\n <div class=\"ResultContent mt-2\">\n Calendar days between the dates\n <\/div>\n\n <div class=\"FieldsResult\">\n <span id=\"DaysCount\" class=\"ResultValue\"><\/span>\n\n <span class=\"right\" id=\"copyIconDaysCount\">\n <svg onclick=\"Copy('DaysCount', 'copyIconDaysCount')\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\"\n width=\"28\" height=\"28\" fill=\"currentColor\" class=\"bi bi-copy\" viewBox=\"0 0 16 16\">\n <path fill-rule=\"evenodd\"\n d=\"M4 2a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2zm2-1a1 1 0 0 0-1 1v8a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1V2a1 1 0 0 0-1-1zM2 5a1 1 0 0 0-1 1v8a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1v-1h1v1a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h1v1z\">\n <\/path>\n <\/svg>\n <\/span>\n <\/div>\n\n\n <\/div>\n\n <div>\n <div class=\"ResultContent\">\n Workdays between the dates\n <\/div>\n\n <div class=\"FieldsResult\">\n <span id=\"WorkingDays\" class=\"ResultValue\"><\/span>\n\n <span class=\"right\" id=\"copyIconWorkingDays\">\n <svg onclick=\"Copy('WorkingDays', 'copyIconWorkingDays')\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\"\n width=\"28\" height=\"28\" fill=\"currentColor\" class=\"bi bi-copy\" viewBox=\"0 0 16 16\">\n <path fill-rule=\"evenodd\"\n d=\"M4 2a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2zm2-1a1 1 0 0 0-1 1v8a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1V2a1 1 0 0 0-1-1zM2 5a1 1 0 0 0-1 1v8a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1v-1h1v1a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h1v1z\">\n <\/path>\n <\/svg>\n <\/span>\n <\/div>\n <\/div>\n\n <\/div>\n\n <script>\n function Calculate() {\n let StartDate = document.getElementById(\"StartDate\").value\n let EndDate = document.getElementById(\"EndDate\").value\n\n if(!StartDate || !EndDate){\n return\n }\n\n let workingDays = getWorkingDays(new Date(StartDate), new Date(EndDate));\n let DaysCount = getDaysDifference(new Date(StartDate), new Date(EndDate));\n\n if(DaysCount<=0){\n getEle(\"ResultSection\").style.display = \"none\"\n return alert(\"Start Date can't be same or forward than the End Date.\")\n }\n\n let IncludeLastDay = document.querySelector('input[name=\"IncludeLastDay\"]:checked').value;\n if(IncludeLastDay==\"Yes\"){\n DaysCount++\n workingDays++\n }\n\n getEle(\"ResultSection\").style.display = \"block\"\n document.getElementById(\"DaysCount\").innerHTML = DaysCount\n document.getElementById(\"WorkingDays\").innerHTML = workingDays\n\n}\n\nfunction getDaysDifference(startDate, endDate) {\n const timeDifference = endDate.getTime() - startDate.getTime();\n const daysDifference = Math.floor(timeDifference \/ (1000 * 60 * 60 * 24));\n return daysDifference;\n}\n\nfunction getWorkingDays(startDate, endDate) {\n let currentDate = new Date(startDate);\n\n let workingDays = 0;\n while (currentDate < endDate) {\n if (currentDate.getDay() !== 0) {\n if(currentDate.getDay() !== 6){\n\n workingDays++;\n }\n }\n currentDate.setDate(currentDate.getDate() + 1);\n }\n\n return workingDays;\n}\n\nasync function Copy(DaysCount, copyIconDaysCount){\n let DaysCountNumber = document.getElementById(DaysCount).innerHTML\n\n let copied = `<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"28\" height=\"28\" fill=\"currentColor\" class=\"bi bi-clipboard-check\" viewBox=\"0 0 16 16\">\n <path fill-rule=\"evenodd\" d=\"M10.854 7.146a.5.5 0 0 1 0 .708l-3 3a.5.5 0 0 1-.708 0l-1.5-1.5a.5.5 0 1 1 .708-.708L7.5 9.793l2.646-2.647a.5.5 0 0 1 .708 0z\"\/>\n <path d=\"M4 1.5H3a2 2 0 0 0-2 2V14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V3.5a2 2 0 0 0-2-2h-1v1h1a1 1 0 0 1 1 1V14a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V3.5a1 1 0 0 1 1-1h1z\"\/>\n <path d=\"M9.5 1a.5.5 0 0 1 .5.5v1a.5.5 0 0 1-.5.5h-3a.5.5 0 0 1-.5-.5v-1a.5.5 0 0 1 .5-.5zm-3-1A1.5 1.5 0 0 0 5 1.5v1A1.5 1.5 0 0 0 6.5 4h3A1.5 1.5 0 0 0 11 2.5v-1A1.5 1.5 0 0 0 9.5 0z\"\/>\n <\/svg>`\n\n await navigator.clipboard.writeText(DaysCountNumber)\n\n document.getElementById(copyIconDaysCount).innerHTML = copied\n setTimeout(() => {\n document.getElementById(copyIconDaysCount).innerHTML = `\n <svg onclick=\"Copy('${DaysCount}', '${copyIconDaysCount}')\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\"\n width=\"28\" height=\"28\" fill=\"currentColor\" class=\"bi bi-copy\" viewBox=\"0 0 16 16\">\n <path fill-rule=\"evenodd\"\n d=\"M4 2a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2zm2-1a1 1 0 0 0-1 1v8a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1V2a1 1 0 0 0-1-1zM2 5a1 1 0 0 0-1 1v8a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1v-1h1v1a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h1v1z\">\n <\/path>\n <\/svg>\n `\n }, 500);\n\n\n}\n\nfunction HideResultSection(){\n getEle(\"ResultSection\").style.display = \"none\"\n}\n\nfunction getEle(e){\n return document.getElementById(e)\n}\n <\/script>\n<\/body>\n<\/html>\n\n\n\n<div class=\"wp-block-buttons is-content-justification-center is-layout-flex wp-container-core-buttons-is-layout-1 wp-block-buttons-is-layout-flex\">\n<div class=\"wp-block-button\"><a class=\"wp-block-button__link wp-element-button\" href=\"https:\/\/robocalculator.com\/convert\/find-days-between-dates\/\">Days Between Dates Calculator<\/a><\/div>\n\n\n\n<div class=\"wp-block-button\"><a class=\"wp-block-button__link wp-element-button\" href=\"https:\/\/robocalculator.com\/calculator\/age-calculator\/\">Age Calculator<\/a><\/div>\n<\/div>\n\n\n\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_65 counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title \" >Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 eztoc-toggle-hide-by-default' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/robocalculator.com\/calculator\/day-counter\/#How_to_Use_Day_Counter_Calculator\" title=\"How to Use Day Counter Calculator?\">How to Use Day Counter Calculator?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/robocalculator.com\/calculator\/day-counter\/#Calculating_Weekday_Count\" title=\"Calculating Weekday Count\">Calculating Weekday Count<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/robocalculator.com\/calculator\/day-counter\/#How_Does_%E2%80%9CInclude_Last_Day%E2%80%9D_Work\" title=\"How Does “Include Last Day” Work?\">How Does “Include Last Day” Work?<\/a><ul class='ez-toc-list-level-4' ><li class='ez-toc-heading-level-4'><ul class='ez-toc-list-level-4' ><li class='ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/robocalculator.com\/calculator\/day-counter\/#References\" title=\"References:\">References:<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/robocalculator.com\/calculator\/day-counter\/#Link_to_this_Page\" title=\"Link to this Page\">Link to this Page<\/a><\/li><\/ul><\/li><\/ul><\/li><\/ul><\/nav><\/div>\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"How_to_Use_Day_Counter_Calculator\"><\/span>How to Use Day Counter Calculator?<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>The <strong>date duration tool <\/strong>is your go-to helper for efficiently managing your time between two specific calendar dates. It’s incredibly straightforward:<\/p>\n\n\n\n<ul>\n<li>Enter\u00a0<strong>Start Date<\/strong>: Enter the starting date (e.g., today’s date or a past event’s date) to kick off the event.<\/li>\n\n\n\n<li>Enter <strong>End Date<\/strong>: Type in the ending date you’re interested in (e.g., a project deadline or an upcoming event’s date).<\/li>\n\n\n\n<li><strong>Include End Date in Calculation?<\/strong> Select the appropriate option to decide if your count should include the last day.<\/li>\n\n\n\n<li>Hit the <strong>Calculate<\/strong> button to execute the function.<\/li>\n<\/ul>\n\n\n\n<p>For instance, if you have a project due on October 30, 2025, just type in today’s date and the due date, then calculate and how many days you have left.<\/p>\n\n\n\n<p>Want to find out the days between holidays like Halloween and Thanksgiving? Input those dates, and you’ll have the duration in a snap. The tool is designed to be flexible, so you can use it for any date-related query.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Calculating_Weekday_Count\"><\/span>Calculating Weekday Count<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>To determine the total number of business days between two dates:<\/p>\n\n\n\n<ul>\n<li>Identify the total weekdays given by the calculator.<\/li>\n\n\n\n<li>Note that this typically reflects the number of standard work days.<\/li>\n\n\n\n<li>If any official holidays occur within this period, deduct their number from the total weekdays to find the actual business days.<\/li>\n<\/ul>\n\n\n\n<p><strong>Quick Tip:<\/strong> Always check for holidays to ensure an accurate business day calculation.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"How_Does_%E2%80%9CInclude_Last_Day%E2%80%9D_Work\"><\/span>How Does “Include Last Day” Work?<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>The calendar gives you the functionality to include ‘last day’ while calculating the workdays between two given dates. If you turn this option on, it will take into account the end date too. For e.g., if the start date is 10th Jan and the end date is 20th Jan, the result will be 11 calendar days and 9 work days. <\/p>\n\n\n\n<p>Without including the ‘last day, the output would be 10 calendar days and 8 work days.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"References\"><\/span>References:<span class=\"ez-toc-section-end\"><\/span><\/h4>\n\n\n\n<p><a href=\"https:\/\/support.microsoft.com\/en-gb\/office\/calculate-the-difference-between-two-dates-8235e7c9-b430-44ca-9425-46100a162f38\" target=\"_blank\" rel=\"noopener\">https:\/\/support.microsoft.com\/en-gb\/office\/calculate-the-difference-between-two-dates-8235e7c9-b430-44ca-9425-46100a162f38<\/a><\/p>\n\n\n\n<p><a href=\"https:\/\/www.ablebits.com\/office-addins-blog\/calculate-number-days-between-dates-excel\/\" target=\"_blank\" rel=\"noopener\">https:\/\/www.ablebits.com\/office-addins-blog\/calculate-number-days-between-dates-excel\/<\/a><\/p>\n\n\n\n<h4><span class=\"ez-toc-section\" id=\"Link_to_this_Page\"><\/span>Link to this Page<span class=\"ez-toc-section-end\"><\/span><\/h4>\r\n\r\nIf you'd like to cite the online calculator on the page, you can use the following citation:\r\nKeith Woods,\u00a0\"<i>Day Counter Calculator – Calculate Days Between Two Dates<\/i>\", Available at: <a href=\"https:\/\/robocalculator.com\/wp-json\/wp\/v2\/posts\/45\">https:\/\/robocalculator.com\/wp-json\/wp\/v2\/posts\/45<\/a>\u00a0URL, Accessed Date: [ May 6, 2024 ]\n","protected":false},"excerpt":{"rendered":"<p>Use this user-friendly day counter calculator to get the total number of days and an exact count of business days for any given period. To simplify things, the day counter calculator has easy-to-follow instructions that guide you through the process. Understanding the tool’s calendar and how to tally up the business days between dates will … <a title=\"Day Counter Calculator – Calculate Days Between Two Dates\" class=\"read-more\" href=\"https:\/\/robocalculator.com\/calculator\/day-counter\/\" aria-label=\"Read more about Day Counter Calculator – Calculate Days Between Two Dates\">Read more<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"_links":{"self":[{"href":"https:\/\/robocalculator.com\/wp-json\/wp\/v2\/posts\/45"}],"collection":[{"href":"https:\/\/robocalculator.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/robocalculator.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/robocalculator.com\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/robocalculator.com\/wp-json\/wp\/v2\/comments?post=45"}],"version-history":[{"count":4,"href":"https:\/\/robocalculator.com\/wp-json\/wp\/v2\/posts\/45\/revisions"}],"predecessor-version":[{"id":78,"href":"https:\/\/robocalculator.com\/wp-json\/wp\/v2\/posts\/45\/revisions\/78"}],"wp:attachment":[{"href":"https:\/\/robocalculator.com\/wp-json\/wp\/v2\/media?parent=45"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/robocalculator.com\/wp-json\/wp\/v2\/categories?post=45"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/robocalculator.com\/wp-json\/wp\/v2\/tags?post=45"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}