Search the Community
Showing results for tags 'difference'.
-
// find the time difference between now and the expiry date $expiry_date = '2017-04-20 09:02:23'; $then = new DateTime($expiry_date); $now = new DateTime(); $remaining_time = $then->diff($now); // I want to add two weeks to the new date. $two_weeks = $now->add(new DateInterval('P2W'))->format('Y-m-d H:i:s'); // new date that combines the remaining time from above and adds 2 weeks to create a new date. This is the issue here. How do I combine these two dates properly? The new date has to be in this format ('Y-m-d H:i:s') $new_date = $remaining_time + $two_weeks;
- 2 replies
-
- dates
- difference
-
(and 3 more)
Tagged with:
-
hi i need help on this, i have three input fields in html form lets say: input 1 = 10 input 2 = 3 input 3 = 13 (sum) so whenever i change values of input 1 or input 2 it will still compute for the sum.. so if: input 1 = 4 input 2 = 3 input 3 = 7 (sum) im using "onchange" method here.. thanks in advance.