Page 1 of 1

Adding Hoursd

Posted: Mon Jan 02, 2006 6:15 pm
by moiseszaragoza
OK
I am using the Date function


Code: Select all

<?php echo date('l dS \of F Y h:i:s A');?>
but I want to show the hour two hours ahead

is there any way to do that like

Code: Select all

<?php echo date('l dS \of F Y h+2:i:s A');?>

Posted: Mon Jan 02, 2006 7:05 pm
by Deemo
strtotime()

so your call would be

Code: Select all

echo date('l dS \of F Y h:i:s A', strtotime("+2 hours"));

Posted: Mon Jan 02, 2006 8:55 pm
by m3mn0n
Moved to PHP Code forum.