How to Add Seconds to Time in PHP?
In this tutorial we will go over the demonstration of how to add seconds to time in php. We will look at example of php add seconds to time. you will learn add 15 seconds to time in php. i would like to share with you how to add 10 seconds to current time in php.
I will give you very simple example how to add seconds to datetime in PHP. so let's see both example with output:
Example 1: PHP Add Seconds to Time
$date = "10:10:05";
$newDate = date('H:i:s', strtotime($date. ' +10 seconds'));
Example 2: PHP Add Seconds to Current DateTime
$newDate = date('H:i:s', strtotime('+10 seconds'));
i hope it can help you...