Jump to content

Calculating with Time - subtract


MrVaux76

Recommended Posts

Hi there smile.gif

Hope someone can help me with this, since I am really stuck.

I have these 2 variables:

$end
$duration

Both of these comes in a HH:MM:SS format (24 hour clock)

I need to subtract the $duration from the $end so I get the $start.

I am getting all kind of weird results, even negative results.

Example:

$end = 22:10:25
$duration = 37:45:28 (I know the days are changing here, but I have no interest in displaying that.)

The $start should then be calculated to 08:24:57 - That I can´t get to Work frown.gif


Anyone who knows how to do this? 

 

Link to comment
https://forums.phpfreaks.com/topic/296369-calculating-with-time-subtract/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.