I have this string object in my php array
"2013-03-05 00: 00: 00 + 00"
I would like to add 12 hours to a post in PHP and then save it back to a string in the same format
I believe this is due to converting the string to a date object. But I'm not sure how smart the date object is, and if I need to specify formatting options or is it supposed to just take a string
$date = new DateTime("2013-03-05 00:00:00+00"); $date->add("+12 hours");
I was returning empty values ββfrom this method or similar ones that I tried
How would you solve this problem?
Thank you, your understanding is appreciated.
source share