Hello I am trying to create my own custom helper class to use with Yii2. It is going to handle times so I\'ll be working with PHP\'s DateTime class. I have
Add use for DateTime:
use
DateTime
use Yii; use DateTime;
See use "global-namespace";
Put a backslash in from of the class name to indicate it is in the global namespace:
$time = new \DateTime('now', new \DateTimeZone('UTC'));