in PHP Code
$timestamp=Date('Y-m-d H:i:s');
I want to get server time in zend controller am using Zend_Date()
but am getting error like that Zend_Date' class not found
please help me any one.
You can see this error because you use Zend Autoloader incorrectly.
Please read this Basic Autoloader Usage.
After you solve autoload problem you can use Zend_Date:
$date = new Zend_Date();
print $date->get();
If you are referencing it from within another namespace you may need to specify the top level namespace try changing $date = new Zend_Date();
to $date = new \Zend_Date();
you can use:
$d = new Zend_Date();
echo 'Your date is: ' . $d->get();
good luck
i did so many research finally i found zend framework2 not having zend_Date class inbuilt-in, So now am using this solution
$this->date = new DateTime();
$this->timestamp = $this->date->format('Y-m-d H:i:s');
Might be helpful to someone.