Amina
Amina

Reputation: 682

How to get current and local time with Zend Framework?

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.

Upvotes: 0

Views: 783

Answers (1)

Ronak K
Ronak K

Reputation: 1567

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

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

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

Upvotes: 1

Related Questions