Where do I find Date class in Zend Framework 2.0?

后端 未结 2 1660
难免孤独
难免孤独 2020-12-16 21:34

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...

相关标签:
2条回答
  • 2020-12-16 21:35

    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.

    0 讨论(0)
  • 2020-12-16 21:38

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

    0 讨论(0)
提交回复
热议问题