...

View Full Version : Getting current date/time and then adding to it



Bobafart
03-20-2007, 04:01 PM
Hi,

I am trying to get the current date/time in PHP in this format: 20070320091012

and then I am trying to add $minutes and $seconds to it
something like:


$timeNow = getdate();? -- I know this is wrong, how to do it?
$timeLater = $timeNow + $minutes + seconds;


where $minutes can equal 2, 3 or 4 for instance and $seconds can equal 15, 30 or 45 for instance

how would I do this in PHP? thanks

devinemke
03-20-2007, 04:24 PM
$current = date('YmdHis');
$later = date('YmdHis', time() + (5 * 60));

echo 'the current time is ' . $current . '<br>in 5 minutes it will be ' . $later;



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum