Location of Zend_Date PHP class

161 Views Asked by At

I'm trying to use the Zend_Date class for my project. I'm working with the PHP Storm IDE and I've searched throughout the ZF2 folder which is included in my project under the:

/vendor/ZF2/library/Zend/ -> now it should be somewhere here but I couldnt've find it in the folder structure...

I've also tried doing the following in code:

$date = new Zend_Date();

but it prints out the following error:

Undefined class Zend_Date

Where am I supposed to find the Zend_Date class, and if it's not included in my folder structure, where can I get it ?

1

There are 1 best solutions below

0
Wilt On

Zend_Date is a class from Zend Framework 1. You seem to be using Zend Framework 2. Don't mix ZF1 and ZF2 functionality.

There is a DateTime class in ZF2 (Zend\Stdlib\DateTime) but it has been deprecated as of ZF 2.1.4. Use the PHP DateTime class instead. Docs can be found here on php.net.