---
title: "How to countdown, 24hour and rules for weekends in jquery?"  
description: "How to countdown, 24hour and rules for weekends in jquery?"  
author: "Anonymous User"  
published: 2015-01-28  
updated: 2015-01-28  
canonical: https://www.mindstick.com/forum/12911/how-to-countdown-24hour-and-rules-for-weekends-in-jquery  
category: "asp.net"  
tags: ["jquery", "javascript"]  
reading_time: 2 minutes  

---

# How to countdown, 24hour and rules for weekends in jquery?

Ive added the [code](https://yourviews.mindstick.com/view/85458/alan-turing-the-mastermind-behind-cracking-the-enigma-code-during-world-war-ii) in here When it hits friday after 11.00 it should countdown to money @ 11.00 Any [suggestions](https://www.mindstick.com/blog/299486/how-to-write-for-your-audience) / help to get here? Also: The CountDown-[timer](https://www.mindstick.com/articles/52/creating-timer-at-runtime-in-c-sharp-dot-net) should also be able to [check if](https://www.mindstick.com/forum/12878/how-to-check-if-an-asp-dot-net-file-upload-control-has-a-file-in-jquery) its a holiday here in Denmark (not sure about this [function](https://www.mindstick.com/articles/13001/multi-statement-table-valued-user-defined-function-in-sql-server), maybe a [database](https://www.mindstick.com/articles/12226/use-of-database-in-sencha-extjs-and-insert-record-from-user-form-using-ajax) to [control](https://www.mindstick.com/blog/197/asp-dot-net-repeater-control) that part, because the holidays will come in [variables](https://www.mindstick.com/articles/715/php-variables) hmm?)

**[HTML](https://www.mindstick.com/articles/1530/design-a-simple-stylish-calculator-using-html-css-and-javascript):**

<div id="countdown"></div>

```
JavaScriptfunction ShowTime() {    var now = new Date();    if (now.getHours() > 11) {        var hrs = 11 - now.getHours() + 24;    } else {        var hrs = 11 - now.getHours();    }    var mins = 60 - now.getMinutes();    var secs = 60 - now.getSeconds();     timeLeft = "You now have " + hrs + ' Hour(s) ' + mins + ' minuts ' + secs + ' seconds' + " To complete the order, and make sure the delivery will reach to you in 1-3 days";    $("#countdown").html(timeLeft);} var countdown; function StopTime() {    clearInterval(countdown); } setInterval(ShowTime, 1000);
```

## Replies

### Reply by Elena Glibart

I am not sure this is you want. Please [check](https://yourviews.mindstick.com/story/2248/never-forget-to-check-these-specifications-before-buying-a-mobile-phone) the code once.

**Javascript:**

```
function ShowTime() {  var now = new Date();    if (now.getHours()> 11){        var hrs =11-now.getHours()+24;        if(now.getDay() == 5){            var hrs =hrs + 48;        }    }else{  var hrs = 11-now.getHours();         }   var mins = 60-now.getMinutes();  var secs = 60-now.getSeconds();       timeLeft = "You now have "+hrs+' Hour(s) '+mins+' minuts '+secs+' seconds' +" To
complete the order, and make sure the delivery will reach to you in 1-3
days";  $("#countdown").html(timeLeft);} var countdown;function StopTime() {    clearInterval(countdown); } setInterval(ShowTime ,1000); 
```


---

Original Source: https://www.mindstick.com/forum/12911/how-to-countdown-24hour-and-rules-for-weekends-in-jquery

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
