Commands And Dates

Hi,

I’m writing a command to be run as cron.

It is very simple, but when I try to user the php DateTime class i get an error with the auto load.

Code:


$currentDate = new DataTime();

Error:


PHP Error[2]: include(DataTime.php): failed to open stream: No such file or directory

UPDATE:

Figured it out:

Used procedural method instead of object.


$currentDate = date_create();

You got the class name wrong, it’s DateTime not DataTime.

Thanks - Long day - should have proof read better