Jump to content

adding 2 hours to now()??


helloise

Recommended Posts

in my MySql database i have a field "created_at"  = now()

for ex: 2011-05-23 11:47:28

 

i need to add two hours to that so i have 2011-05-23 13:47:28

how will i do this please?

 

i have this so far but it is not correct:

 

    $currentTime = time($msg->getCreatedAt());

    $timeAfterOneHour = $currentTime+60*60;

    $date=date("Y-m-d H:i:s",$timeAfterOneHour);

 

please help

thank you

Link to comment
https://forums.phpfreaks.com/topic/237307-adding-2-hours-to-now/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.