Home » mysql, PHP Code »

0

Hello friends,

The following query will add some times to mysql date column.

Get the today date :

$date = date(‘Y-m-d H:i:s’);

Convert it into strtotime and add which one we have to add, here i am going to add 30 minutes to existing time.

$newtime = strtotime($date . ‘ + 30 minutes’);

Covert the newtime to date format like below.

$newtime = date(‘Y-m-d H:i:s’, $newtime);

Here we will get the answer , same thing we can apply for mysql datetime column field also.


Related Posts

    How to import and export big database filesHow to build virtual keyboard for your web applicationObject oriented programming in phpAuto post into Blogspot using php code?

 

Leave a Reply