NerdConcepts Posted August 24, 2009 Share Posted August 24, 2009 Seemed so simple when I started. I can easily subtract time (working with hours/minutes/seconds...00:00:00 format), but 5 hours of doing one thing after another I'm done, time to ask for him. I've tried just using MySQL and tried using PHP only, then tried both and still nothing. For some reason when using a simple (note: values or given not variables, first time is from DB, second is simulated current time) mysql_query("SELECT TIMEDIFF('08:45:00', '09:00:00'')"); returns -00:15:00 mysql_query("SELECT TIMEDIFF('09:15:00', '09:00:00')"); returns 00:15:00 Is there a way to take the 00:15:00 and convert it just into minutes, so I know if it is -15 or 15? I know that would work but cannot figure it out. I need to run a command if the value is 15-6 and a different one if the value is 5 or less. So if, example, I had 9am as current time and list time is 11am it would return "120' thus not running either of my commands... Hope my explanation explains it... Link to comment https://forums.phpfreaks.com/topic/171612-subtracting-time/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.