9
votes

I have started my ZF2 application from Skeleton-Application. I want instance of Date class in one of my controller. I tried to search Date.php class under...

library\Zend\

but could not found. Does ZF2 has not Date.php at all or I need to palce it from somewhere else?

2

2 Answers

18
votes

Zend_Date has been removed in favor of PHP 5.3 DateTime API http://es.php.net/manual/en/book.datetime.php

1
votes

Don't forget to call DateTime() in Zend Framework 2 like base class.
Like:

$date = new \DateTime($str);

where $str is a string from which you create date object.