Page 1 of 1

countup

Posted: Fri Dec 19, 2003 11:59 am
by Vietboy
I don't see any scripts that count up.. mostly i see countdown

Any one has the code for count up?

Each day + 1

Posted: Fri Dec 19, 2003 12:29 pm
by Saethyr
This Should get you close. There are probably much easier ways but I wrote this in a hurry and it seems to qwork, this is good to 2 decimal places.

Code: Select all

<?php
$StartDate = mktime(0,0,0,12,18,2003); //mktime(hour, minute, second, month, day, year)
$DateToday = mktime(date("h, i, s, m, d, Y"));//todays date

$dateDiff = $DateToday - $StartDate;

$NumDays = round($dateDiff/60/60/24, 2);


echo 'Difference in days: ' . $NumDays . '<br />';
?>
Saethyr