How To Add Seconds To Current Datetime In Php?

03-Apr-2023

.

Admin

Hi Guys,

In this example,I will learn you add seconds to current date in php.you can easy and simply add seconds to current date in php.

we will show add seconds in current date php.this tutorial will give you example of add seconds to current date using php.

Example:


<?php

// Add current time 15 seconds

$date = date('Y-m-d H:i:s', (time() + 15));

echo $date;

?>

Output:

2020-12-22 10:26:34

It will help you...

#PHP