I ran into a very dangerous problem
I am trying to use the new php class "DateTime" for the date. I am using the latest version of php 5.3.12.
The code works fine when I use regular PHP code. (I mean another application without Zend), but when I used the same code in the controller, it gives me an error
Fatal error: Class 'User \ Controller \ DateTime' not found in C: \ wamp \ www \ 1625 \ module \ User \ src \ User \ Controller \ UserController.php on line 65
I did not understand, because "DateTime" is a php inbuild class
Code below
$date = new DateTime(date('Y').'-'.date('m').'-01'); echo "<li>".$date_now = $date->format('Ym-d');
source share