How to display a countdown in Hours and Minutes from end of the day + 16 hours using JavaScript.
Assume i have a woocommerce shop and i provide a option to customers, When they order before 4.00 P.M Next Day. I ship the Product On same day. I want to display a count down on my page something like this
"Order in next X hours Y Minutes to get it by AA BB CC"
Here AA = Date, BB=Month, CCC=Year
Example :
Considering time right now is 9.30 P.M on 1st February 2021. I want the countdown to display just like following
"Order in next 18 hours 30 Minutes to get it by 4th February 2021"
[If customer is going to order Now]
I deliver it within 3 days. So if they order the product in 1st February 2021 they will get it 4th February 2021.
4
Answers
first of all what you need to do is first find the difference between the 2 time
suppose order before 8 hours to get this in 3 days
so check if order is not placed then show counter for the time
refer this to make countdown
https://www.w3schools.com/howto/howto_js_countdown.asp
if the order is placed then show the counter for 3 days
Try this one
HTML
CSS
JS (by learning from here)
(i)The code may not be correct.
But it works like a countdown.
// Fork from https://codepen.io/afarrar/pen/JRaEjP
HTML
CSS
JS