Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Difference between two unix timestamps

Status
Not open for further replies.

jgd12345

Technical User
Joined
Apr 22, 2003
Messages
124
Location
GB
Hi, the following finds the number of days between two dates. But I wish for it to display in the format x (days) x (hours) x (minutes) x (seconds). If someone could help I'd be greatful. Thanx

$time = time();
$endtime = mktime (21,8,32,8,12,2003);

$difference = $endtime - $time;
$diffday = $difference / 86400;
echo "$diffday (days)";
 
Cheers it worked a treat.
 
That cleared up one thing I wanted todo but I also need a part which just does days, hours, minutes and seconds kind off like a countdown. If you can help i'd be greatful.

Thanx
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top