Hi Everybody ,i have a problem with DateTime class,I am using DateTime class in my program it works fine in php 5.2.6 .but the version in my server is php 5.1.6 so is there any class to replace the same functionality.please check the code below and if u find any solution for this please reply me.
// first convert the timestamp into a string representing the local time
$time = date('r', $timestamp);
// now create the DateTime object for this time
$dtime = new DateTime($date);
// convert this to the user's timezone using the DateTimeZone object
$dtime->setTimeZone($dtzone);
// print the time using your preferred format
$time = $dtime->format('Y-m-d-H-i-s');
return$time;
}
?>
Last edited by peter_budo; May 22nd, 2009 at 4:03 pm. Reason: Keep It Organized - For easy readability, always wrap programming code within posts in [code] (code blocks) and [icode] (inline code) tags.
which part is causing the problem? Isolate the steps and echo or print out the variables. You need to know which elements are causing problems before you start making wholesale changes.
which part is causing the problem? Isolate the steps and echo or print out the variables. You need to know which elements are causing problems before you start making wholesale changes.
No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.