How can I add 30 seconds to this time?
$time = date(\"m/d/Y h:i:s a\", time());
I wasn\'t sure how to do it because it is showing lots of diffe
You could solve this with a bit different perspective. First, you can create a current datetime object. Then, you create a future datetime which is 30 seconds later then your given datetime. So it boils down to the following:
(new Future(
new Now(),
new NSeconds(30)
))
->value();
If you want to output in a specific format you've mentioned, it can be achieved with
(new ISO8601Formatted(
new Future(
new Now(),
new NSeconds(30)
),
'm/d/Y h:i:s a'
))
->value()