hello, $datetime=date("Y-m-d H:i:s"); PHP: I want to add one second to $datetime How can i do this? Thanks
You want the DateTime::add... Here is some information of how to use it properly. http://us.php.net/manual/en/datetime.add.php
You should try the following code: <?php $time_sec1 = date("s"); $time_sec2 = $imte_sec1 + 1; $datetime=date("Y-m-d H:i:" . $time_sec2 . ""); ?> PHP: It should work without any problem.