How to get current and local time with Zend Framework?

777 Views Asked by At

In my App i have to get my local time ,I used this code :

    $date = new Zend_Date();
$time = $date->get(Zend_Date::TIME_LONG);

But it gives me 7:51:00 AM UTC ,UTC time . Can someone help me to get my local time. Thanks.

1

There are 1 best solutions below

0
On

Try This, and please refer document it is given in length in that..

$date->setTimezone($user->timezone);

echo $date->get(Zend_Date::TIME_SHORT);