Simple question but this is killing my time.
Any simple solution to add 30 minutes to current time in php with GMT+8?
The question is a little old, but I come back to it often ;p
Another way, which is also a one liner:
= date_create('2111-11-11 00:00:00')->modify("+30 minutes")->format('Y-m-d h:i:s') ?>
Or from timestamp, returns Y-m-d h:i:s:
= date_create('@'.time())->modify("+30 minutes")->format('Y-m-d h:i:s') ?>
Or from timestamp, returns timestamp:
= date_create('@'.time())->modify("+30 minutes")->format('U') ?>