| View previous topic :: View next topic |
| Author |
Message |
Mike
Joined: 20 Feb 2010 Posts: 23
|
Posted: Tue Mar 09, 2010 1:33 pm Post subject: how to add 20 minutes in past date |
|
|
Hi,
I need to add 20 minutes with my past date which is in db.
do you any done this?
Regards
Mike |
|
| Back to top |
|
 |
AnilKumar

Joined: 09 May 2008 Posts: 197
|
Posted: Wed Mar 10, 2010 4:34 am Post subject: |
|
|
Hello Mike,
Following is the code for getting the date after add 20 minutes for current date.
// Get the today date
echo $date = date('Y-m-d H:i:s');
echo "<br>";
// Adding 20 minutes to current date
$newtime = strtotime($date . ' + 20 minutes');
echo "<br>";
// convert it into our format.
echo $newtime = date('Y-m-d H:i:s', $newtime);
Thank you,
Anil Kumar  |
|
| Back to top |
|
 |
Mike
Joined: 20 Feb 2010 Posts: 23
|
Posted: Wed Mar 10, 2010 1:29 pm Post subject: |
|
|
Hi Anil,
Thanks,i integrate that code.its working fine.Its really cool
Regards
Mike |
|
| Back to top |
|
 |
|