I have $adate;
which contains:
Tue Jan 4 07:59:59 2011
I want to add to this date the following:
$duration=674165; // in seconds
Once the seconds are added I need the result back into date format.
I don't know what I'm doing, but I am getting odd results.
Note: both variables are dynamic. Now they are equal to the values given, but next query they will have different values.
Do this:
I have trouble with
strtotime()
to resolve my problem of add dynamic data/time value in the current timeThis was my solution:
font: https://secure.php.net/manual/en/datetime.add.php (consult Object Oriented style too, the Elzo Valugi solution)
(1) https://secure.php.net/manual/en/function.date.php
I made this example for a timezone, but if you change some parts it may help you out:
Result: