Access Posted May 26, 2006 Share Posted May 26, 2006 Hello,Im curious if their is a simple way to add and subtract between two times that are in the PHP date() format?To clarify;I have two variables;$time1 and $time2;both in the form date('H:i:s');How can I achive the result that logically equates to;$time3 = $time1 + $time1;AND$time3 = $time2 - $time1;This doesnt appear to work.. is their an easy way to accomplish this without doing the whole thing manually.ThanksAccess Link to comment https://forums.phpfreaks.com/topic/10474-php-time/ Share on other sites More sharing options...
poirot Posted May 26, 2006 Share Posted May 26, 2006 What do you want exactly? If you don't have the timestamp anymore (or aren't able to generate it using mktime()) I am afraid you are going to need to convert it to seconds and subtract / sum. Link to comment https://forums.phpfreaks.com/topic/10474-php-time/#findComment-39114 Share on other sites More sharing options...
Access Posted May 28, 2006 Author Share Posted May 28, 2006 [!--quoteo(post=377230:date=May 26 2006, 03:27 PM:name=poirot)--][div class=\'quotetop\']QUOTE(poirot @ May 26 2006, 03:27 PM) [snapback]377230[/snapback][/div][div class=\'quotemain\'][!--quotec--]What do you want exactly? If you don't have the timestamp anymore (or aren't able to generate it using mktime()) I am afraid you are going to need to convert it to seconds and subtract / sum.[/quote]Okay, so I have to do all Manipulation with Time stamps. I guess I was just under the impression that I could some how manipulate times using php date variables alones.Thanks. Link to comment https://forums.phpfreaks.com/topic/10474-php-time/#findComment-39703 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.