PHP Classes

PHP Countdown Timer: Show the time that remains until a given date

Recommend this page to a friend!
  Info   View files Example   View files View files (2)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not yet rated by the usersTotal: 241 All time: 8,022 This week: 206Up
Version License PHP version Categories
countdown-timer 1Freely Distributable5.0PHP 5, Time and Date


This class can display the time that remains until a given date.

It takes an array of parameters that define the initial and final dates, and the format of the output of the time from the initial to the final date.

The class computes the difference between the dates and returns a string with either the number of remaining days, a timer with the remaining years, months, days, hours, minutes and seconds, or in a raw format.

Picture of breuls peter
  Performance   Level  
Name: breuls peter <contact>
Classes: 1 package by
Country: Belgium Belgium
Age: ???
All time rank: 401223 in Belgium Belgium
Week rank: 228 Up2 in Belgium Belgium Up


What is the best PHP timer countdown class?
I need a php class that will countdown to 24 hours after a given



//include class file to your document
include 'timeDiff.php';

//activate class
$timeDiff = new timeDiff();

//enter args to get started
$args = array(
'inputFormat' => array(
'from' => array(
'date' => date('Y-m-d'), //date from where to start 2019-03-29 / date('Y-m-d')
'time' => date('H:i:s') //default empty / 23:59:59
'till' => array(
'date' => '2016-12-25', //date till where to end
'time' => '12:00:00' //default empty / 23:59:59
'outputFormat' => array(
'command' => 'raw'
//supported return command
                //raw or empty = return raw usable array
                //rawNoEmpty = return raw usable array with 0 int
                //timer = return a str value, format hours:minutes:seconds
                //days = return a str value, format number of days till end time
            //raw supported output data
                //y = years
                //m = months
                //d = days
                //h = hours
                //i = minutes
                //s = seconds

$result = $timeDiff->getDiff($args);
'the args';
'<br />';
'<br />';
'the result';
'<br />';


  Files folder image Files  
File Role Description
Accessible without login Plain text file timer.php Example Date timer
Plain text file timeDiff.php Class class file Date timer

 Version Control Unique User Downloads Download Rankings  
This week:0
All time:8,022
This week:206Up