Forum Moderators: coopster

Message Too Old, No Replies

mktime problems

Something isn't adding up...

         

inveni0

11:28 pm on Nov 7, 2007 (gmt 0)

10+ Year Member



I'm trying to add three minutes to the current time. The following code:

$timestamp = date('i:s', mktime(date('H'),date('i'),date('s')+180,0,0,0));

outputs 59:59.

I have also tried:

$timestamp = date('i:s', mktime(date('H'),date('i')+3,date('s'),0,0,0));

to no avail. Any ideas?

Thanks!

phparion

5:14 am on Nov 8, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



to add three minutes to the current time try

$time = time() + 180;

Habtom

11:09 am on Nov 8, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



. . . alternatively:

$time = strtotime("+3 minutes");