Search code examples
phpjavascripttimercountdown

PHP Countdown like Amazon Delivery


I have been wondering this for a while and has searched for an answer over the internet but still no luck.

My question is: How do I create a timer be it in Javascript or PHP like the one amazon uses to tell you how long you have left to order for a specified delivery time.

Example: I am talking about the text that displays: Want delivery by Monday, 13 May? Order it in the next 18 hours and 29 minutes.

I hope I have made some sense. If anyone could help me or point me in the right direction that would be great!


Solution

  • hope this points you in the right direction:

    http://php.net/manual/en/function.date.php

    PHP Calculating future date by adding days to a variable date

    Javascript Countdown