[RESOLVED] mysql time remaining
I'm trying to calculate the time remaining left on an "auction". This is the code I have:
However, it only pulls the days. How can I get it to pull the seconds as well?
SELECT DATEDIFF(CURDATE(), endtime) AS timeleft FROM `auctions` WHERE `id` = '".$id."'
what format is your end date?
TIMEDIFF() returns expr1 – expr2 expressed as a time value. expr1 and expr2 are time or date-and-time expressions, but both must be of the same type
use NOW() for date/time, and CURTIME for time.
Last edited by scragar; 02-09-2008 at 05:29 PM.
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)