How To Add Seconds To Current Datetime In Php?

PHP

Nicesnippets

16398

22-12-2020


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...