John Noel Alcantara
John Noel Alcantara

Reputation: 3

Adding seconds in time

I don't know how to add seconds to the current time. Here is my code of saving time.

$timereg = date("g:i:s A", time());

For example the time is exactly 9:30:00

I just want to make it 9:30:02, like that.

Upvotes: 0

Views: 77

Answers (1)

TheOnly92
TheOnly92

Reputation: 1763

Well you can do

$timereg = date("g:i:s A", time() + 2);

And I believe it will show the current time +2 seconds.

Upvotes: 5

Related Questions