Page 1 of 1

time()

Posted: Sun Jun 04, 2006 5:55 pm
by psychotomus
how would I go about adding say 2 minutes to time()??


$new_time = time() + (120 * 60) ??

Posted: Sun Jun 04, 2006 6:01 pm
by Oren
Both will do the job:

Code: Select all

$new_time = strtotime("+2 minutes");

Code: Select all

$new_time = time() + 120;

Posted: Sun Jun 04, 2006 8:23 pm
by Ambush Commander
Remember: time() gives back seconds.