Error code: codingerror !! !! when using new DateTime(...)

Error code: codingerror !! !! when using new DateTime(...)

by Ludo M -
Number of replies: 0
Hello,

I have an error when I try to modify a cron task:
If I add this line
$today= new DateTime("now", new DateTimeZone('Europe/Paris') );

I have this error:

!!! Erreur de programmation détectée. Ceci doit être corrigé par un programmeur : A lock was created but not released at: [dirroot]\lib\classes\task\manager.php on line 483 Code should look like: $factory = \core\lock\lock_config::get_lock_factory('type'); $lock = $factory->get_lock(Resource id #572); $lock->release(); // Locks must ALWAYS be released like this. !!! !! Error code: codingerror !! !! Stack trace: * line 117 of \lib\classes\lock\lock.php: coding_exception thrown * line 85 of \lib\cronlib.php: call to core\lock\lock->__destruct() * line 81 of \admin\cron.php: call to cron_run() !!

I don't understand the problem as this line works well in a simple php file, where does the problem come ?
Average of ratings: -