I want to add 3 minutes to a date/time variable I have, but I'm not sure how to do this.
I made the variable from a string like this: (which is in the RFC 2822 date format btw)
$date = 2011-10-18T19:56:00+0200
I converted that string into date using this command:
$time = date_format(DateTime::createFromFormat("Y-m-dTH:i:sO", $date), "G:i")
Now, I'd like to add 3 minutes to that variable, but I I'm not sure how.
I've used the following command in my script before, but that applies to the current date/time, so I'm not sure how to use that for my time variable:
$currenttime = date('G:i', strtotime('+2 hours'));
So, how can I add three minutes to the $time variable?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…