Jump to content

PHP Time


Access

Recommended Posts

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.

Thanks
Access
Link to comment
https://forums.phpfreaks.com/topic/10474-php-time/
Share on other sites

[!--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

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.