2
i couldn't understand your requirement completely but seems you want something like between 15 to 13 (22 hrs) and then 13 to 15 (2 hrs) then please test this logic
- <!DOCTYPE html>
- <html>
- <head>
- <title></title>
- <meta name="viewport" content="width=device-width, initial-scale=1">
- <script src="~/Scripts/jquery-3.4.1.min.js"></script>
- <style>
-
-
- #the-final-countdown {
- background: #333;
- font-family: 'Lato', sans-serif;
- text-align: center;
- color: #eee;
- text-shadow: 1px 1px 5px black;
- padding: 1rem 0;
- font-size: 3rem;
- border: 1px solid #000;
- }
- </style>
- </head>
- <body>
-
- <div id="the-final-countdown">
- <p></p>
- </div>
-
- <script>
- $(function () {
-
- setInterval(function time() {
- var d = new Date();
- if (d.getHours != 14 || d.getHours != 15) {
-
- var hours = 22 - d.getHours();
- }
- else {
- var hours = 2 - d.getHours();
- }
-
-
-
- var min = 60 - d.getMinutes();
- if ((min + '').length == 1) {
- min = '0' + min;
- }
- var sec = 60 - d.getSeconds();
- if ((sec + '').length == 1) {
- sec = '0' + sec;
- }
- $('#the-final-countdown p').html(hours + ':' + min + ':' + sec)
-
-
- },1000)
-
-
- })
-
- </script>
-
- </body>
- </html>

1
hello mr.Sachin Singh
I guess you brought me luck. I finally did. Thanks for your help. I couldn't have done this without you. thank you so much. :)
1
please use as it is by copy paste and test
and then let me know what are you getting and what should be the exact results so that i could help in right direction.
thanks.