{"id":25949,"date":"2022-12-14T15:11:02","date_gmt":"2022-12-14T09:41:02","guid":{"rendered":"https:\/\/jassweb.com\/solved\/solved-countdown-that-can-mix-various-times\/"},"modified":"2022-12-14T15:11:02","modified_gmt":"2022-12-14T09:41:02","slug":"solved-countdown-that-can-mix-various-times","status":"publish","type":"post","link":"https:\/\/jassweb.com\/solved\/solved-countdown-that-can-mix-various-times\/","title":{"rendered":"[Solved] Countdown that can mix various times"},"content":{"rendered":"<p> [ad_1]<br \/>\n<\/p>\n<div id=\"answer-49847084\" class=\"answer js-answer accepted-answer js-accepted-answer\" data-answerid=\"49847084\" data-parentid=\"49845412\" data-score=\"0\" data-position-on-page=\"1\" data-highest-scored=\"1\" data-question-has-accepted-highest-score=\"1\" itemprop=\"acceptedAnswer\" itemscope itemtype=\"https:\/\/schema.org\/Answer\">\n<div class=\"post-layout\">\n<div class=\"votecell post-layout--left\"><\/div>\n<div class=\"answercell post-layout--right\">\n<div class=\"s-prose js-post-body\" itemprop=\"text\">\n<p>Try this<br \/>\n<a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/jsfiddle.net\/6bd3L1ew\/7\/\">https:\/\/jsfiddle.net\/6bd3L1ew\/7\/<\/a><\/p>\n<pre><code>config = {\n'0':8,\n'1':7,\n'2':6,\n'3':5,\n'4':4,\n'5':3,\n'6':2,\n'7':1,\n'8':1,\n'9':1,\n'10':1,\n'11':1,\n'12':1,\n'13':1,\n'14':1,\n'15':1,\n'16':1,\n'17':15,\n'18':14,\n'19':13,\n'20':12,\n'21':11,\n'22':10,\n'23':9\n}\n\nvar start = new Date();\n\nfunction pad(num) {\n  return (\"0\" + parseInt(num)).substr(-2);\n}\n\nfunction tick() {\n\n  var nowTime = new Date().getHours();\n  var untilTime = new Date().getHours() + config[nowTime]\n\n  start.setHours(untilTime, 0, 0);\n\n  var now = new Date();\n  if (now &gt; start) { \/\/ too late, go to tomorrow\n    start.setDate(start.getDate() + 1);\n  }\n  var remain = ((start - now) \/ 1000);\n  var hh = pad((remain \/ 60 \/ 60) % 60);\n  var mm = pad((remain \/ 60) % 60);\n  var ss = pad(remain % 60);\n  document.getElementById('time').innerHTML =\n    hh + \":\" + mm + \":\" + ss;\n  setTimeout(tick, 1000);\n}\n\ntick();\n<\/code><\/pre>\n<\/p><\/div>\n<div class=\"mt24\"><\/div>\n<\/div>\n<p>            <span class=\"d-none\" itemprop=\"commentCount\">3<\/span> <\/p><\/div>\n<\/div>\n<p>[ad_2]<\/p>\n<p>solved Countdown that can mix various times <\/p>\n","protected":false},"excerpt":{"rendered":"<p>[ad_1] Try this https:\/\/jsfiddle.net\/6bd3L1ew\/7\/ config = { &#8216;0&#8217;:8, &#8216;1&#8217;:7, &#8216;2&#8217;:6, &#8216;3&#8217;:5, &#8216;4&#8217;:4, &#8216;5&#8217;:3, &#8216;6&#8217;:2, &#8216;7&#8217;:1, &#8216;8&#8217;:1, &#8216;9&#8217;:1, &#8217;10&#8217;:1, &#8217;11&#8217;:1, &#8217;12&#8217;:1, &#8217;13&#8217;:1, &#8217;14&#8217;:1, &#8217;15&#8217;:1, &#8217;16&#8217;:1, &#8217;17&#8217;:15, &#8217;18&#8217;:14, &#8217;19&#8217;:13, &#8217;20&#8217;:12, &#8217;21&#8217;:11, &#8217;22&#8217;:10, &#8217;23&#8217;:9 } var start = new Date(); function pad(num) { return (&#8220;0&#8221; + parseInt(num)).substr(-2); } function tick() { var nowTime = new Date().getHours(); var untilTime &#8230; <a title=\"[Solved] Countdown that can mix various times\" class=\"read-more\" href=\"https:\/\/jassweb.com\/solved\/solved-countdown-that-can-mix-various-times\/\" aria-label=\"More on [Solved] Countdown that can mix various times\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[320],"tags":[333,339,597],"class_list":["post-25949","post","type-post","status-publish","format-standard","hentry","category-solved","tag-javascript","tag-php","tag-wordpress"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>[Solved] Countdown that can mix various times - JassWeb<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/jassweb.com\/solved\/solved-countdown-that-can-mix-various-times\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"[Solved] Countdown that can mix various times - JassWeb\" \/>\n<meta property=\"og:description\" content=\"[ad_1] Try this https:\/\/jsfiddle.net\/6bd3L1ew\/7\/ config = { &#039;0&#039;:8, &#039;1&#039;:7, &#039;2&#039;:6, &#039;3&#039;:5, &#039;4&#039;:4, &#039;5&#039;:3, &#039;6&#039;:2, &#039;7&#039;:1, &#039;8&#039;:1, &#039;9&#039;:1, &#039;10&#039;:1, &#039;11&#039;:1, &#039;12&#039;:1, &#039;13&#039;:1, &#039;14&#039;:1, &#039;15&#039;:1, &#039;16&#039;:1, &#039;17&#039;:15, &#039;18&#039;:14, &#039;19&#039;:13, &#039;20&#039;:12, &#039;21&#039;:11, &#039;22&#039;:10, &#039;23&#039;:9 } var start = new Date(); function pad(num) { return (&quot;0&quot; + parseInt(num)).substr(-2); } function tick() { var nowTime = new Date().getHours(); var untilTime ... Read more\" \/>\n<meta property=\"og:url\" content=\"https:\/\/jassweb.com\/solved\/solved-countdown-that-can-mix-various-times\/\" \/>\n<meta property=\"og:site_name\" content=\"JassWeb\" \/>\n<meta property=\"article:published_time\" content=\"2022-12-14T09:41:02+00:00\" \/>\n<meta name=\"author\" content=\"Kirat\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Kirat\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/jassweb.com\/solved\/solved-countdown-that-can-mix-various-times\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/jassweb.com\/solved\/solved-countdown-that-can-mix-various-times\/\"},\"author\":{\"name\":\"Kirat\",\"@id\":\"https:\/\/jassweb.com\/solved\/#\/schema\/person\/65c9c7b7958150c0dc8371fa35dd7c31\"},\"headline\":\"[Solved] Countdown that can mix various times\",\"datePublished\":\"2022-12-14T09:41:02+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/jassweb.com\/solved\/solved-countdown-that-can-mix-various-times\/\"},\"wordCount\":24,\"publisher\":{\"@id\":\"https:\/\/jassweb.com\/solved\/#organization\"},\"keywords\":[\"javascript\",\"php\",\"wordpress\"],\"articleSection\":[\"Solved\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/jassweb.com\/solved\/solved-countdown-that-can-mix-various-times\/\",\"url\":\"https:\/\/jassweb.com\/solved\/solved-countdown-that-can-mix-various-times\/\",\"name\":\"[Solved] Countdown that can mix various times - JassWeb\",\"isPartOf\":{\"@id\":\"https:\/\/jassweb.com\/solved\/#website\"},\"datePublished\":\"2022-12-14T09:41:02+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/jassweb.com\/solved\/solved-countdown-that-can-mix-various-times\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/jassweb.com\/solved\/solved-countdown-that-can-mix-various-times\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/jassweb.com\/solved\/solved-countdown-that-can-mix-various-times\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/jassweb.com\/solved\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"[Solved] Countdown that can mix various times\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/jassweb.com\/solved\/#website\",\"url\":\"https:\/\/jassweb.com\/solved\/\",\"name\":\"JassWeb\",\"description\":\"Build High-quality Websites\",\"publisher\":{\"@id\":\"https:\/\/jassweb.com\/solved\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/jassweb.com\/solved\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/jassweb.com\/solved\/#organization\",\"name\":\"Jass Web\",\"url\":\"https:\/\/jassweb.com\/solved\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/jassweb.com\/solved\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/jassweb.com\/wp-content\/uploads\/2021\/02\/jass-website-logo-1.png\",\"contentUrl\":\"https:\/\/jassweb.com\/wp-content\/uploads\/2021\/02\/jass-website-logo-1.png\",\"width\":693,\"height\":132,\"caption\":\"Jass Web\"},\"image\":{\"@id\":\"https:\/\/jassweb.com\/solved\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/jassweb.com\/solved\/#\/schema\/person\/65c9c7b7958150c0dc8371fa35dd7c31\",\"name\":\"Kirat\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/jassweb.com\/solved\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/jassweb.com\/solved\/wp-content\/litespeed\/avatar\/1261af3c9451399fa1336d28b98ea3bb.jpg?ver=1775193939\",\"contentUrl\":\"https:\/\/jassweb.com\/solved\/wp-content\/litespeed\/avatar\/1261af3c9451399fa1336d28b98ea3bb.jpg?ver=1775193939\",\"caption\":\"Kirat\"},\"sameAs\":[\"http:\/\/jassweb.com\"],\"url\":\"https:\/\/jassweb.com\/solved\/author\/jaspritsinghghumangmail-com\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"[Solved] Countdown that can mix various times - JassWeb","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:\/\/jassweb.com\/solved\/solved-countdown-that-can-mix-various-times\/","og_locale":"en_US","og_type":"article","og_title":"[Solved] Countdown that can mix various times - JassWeb","og_description":"[ad_1] Try this https:\/\/jsfiddle.net\/6bd3L1ew\/7\/ config = { '0':8, '1':7, '2':6, '3':5, '4':4, '5':3, '6':2, '7':1, '8':1, '9':1, '10':1, '11':1, '12':1, '13':1, '14':1, '15':1, '16':1, '17':15, '18':14, '19':13, '20':12, '21':11, '22':10, '23':9 } var start = new Date(); function pad(num) { return (\"0\" + parseInt(num)).substr(-2); } function tick() { var nowTime = new Date().getHours(); var untilTime ... Read more","og_url":"https:\/\/jassweb.com\/solved\/solved-countdown-that-can-mix-various-times\/","og_site_name":"JassWeb","article_published_time":"2022-12-14T09:41:02+00:00","author":"Kirat","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Kirat","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/jassweb.com\/solved\/solved-countdown-that-can-mix-various-times\/#article","isPartOf":{"@id":"https:\/\/jassweb.com\/solved\/solved-countdown-that-can-mix-various-times\/"},"author":{"name":"Kirat","@id":"https:\/\/jassweb.com\/solved\/#\/schema\/person\/65c9c7b7958150c0dc8371fa35dd7c31"},"headline":"[Solved] Countdown that can mix various times","datePublished":"2022-12-14T09:41:02+00:00","mainEntityOfPage":{"@id":"https:\/\/jassweb.com\/solved\/solved-countdown-that-can-mix-various-times\/"},"wordCount":24,"publisher":{"@id":"https:\/\/jassweb.com\/solved\/#organization"},"keywords":["javascript","php","wordpress"],"articleSection":["Solved"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/jassweb.com\/solved\/solved-countdown-that-can-mix-various-times\/","url":"https:\/\/jassweb.com\/solved\/solved-countdown-that-can-mix-various-times\/","name":"[Solved] Countdown that can mix various times - JassWeb","isPartOf":{"@id":"https:\/\/jassweb.com\/solved\/#website"},"datePublished":"2022-12-14T09:41:02+00:00","breadcrumb":{"@id":"https:\/\/jassweb.com\/solved\/solved-countdown-that-can-mix-various-times\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/jassweb.com\/solved\/solved-countdown-that-can-mix-various-times\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/jassweb.com\/solved\/solved-countdown-that-can-mix-various-times\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/jassweb.com\/solved\/"},{"@type":"ListItem","position":2,"name":"[Solved] Countdown that can mix various times"}]},{"@type":"WebSite","@id":"https:\/\/jassweb.com\/solved\/#website","url":"https:\/\/jassweb.com\/solved\/","name":"JassWeb","description":"Build High-quality Websites","publisher":{"@id":"https:\/\/jassweb.com\/solved\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/jassweb.com\/solved\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/jassweb.com\/solved\/#organization","name":"Jass Web","url":"https:\/\/jassweb.com\/solved\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/jassweb.com\/solved\/#\/schema\/logo\/image\/","url":"https:\/\/jassweb.com\/wp-content\/uploads\/2021\/02\/jass-website-logo-1.png","contentUrl":"https:\/\/jassweb.com\/wp-content\/uploads\/2021\/02\/jass-website-logo-1.png","width":693,"height":132,"caption":"Jass Web"},"image":{"@id":"https:\/\/jassweb.com\/solved\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/jassweb.com\/solved\/#\/schema\/person\/65c9c7b7958150c0dc8371fa35dd7c31","name":"Kirat","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/jassweb.com\/solved\/#\/schema\/person\/image\/","url":"https:\/\/jassweb.com\/solved\/wp-content\/litespeed\/avatar\/1261af3c9451399fa1336d28b98ea3bb.jpg?ver=1775193939","contentUrl":"https:\/\/jassweb.com\/solved\/wp-content\/litespeed\/avatar\/1261af3c9451399fa1336d28b98ea3bb.jpg?ver=1775193939","caption":"Kirat"},"sameAs":["http:\/\/jassweb.com"],"url":"https:\/\/jassweb.com\/solved\/author\/jaspritsinghghumangmail-com\/"}]}},"_links":{"self":[{"href":"https:\/\/jassweb.com\/solved\/wp-json\/wp\/v2\/posts\/25949","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jassweb.com\/solved\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jassweb.com\/solved\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jassweb.com\/solved\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/jassweb.com\/solved\/wp-json\/wp\/v2\/comments?post=25949"}],"version-history":[{"count":0,"href":"https:\/\/jassweb.com\/solved\/wp-json\/wp\/v2\/posts\/25949\/revisions"}],"wp:attachment":[{"href":"https:\/\/jassweb.com\/solved\/wp-json\/wp\/v2\/media?parent=25949"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jassweb.com\/solved\/wp-json\/wp\/v2\/categories?post=25949"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jassweb.com\/solved\/wp-json\/wp\/v2\/tags?post=25949"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}