Use DateTimeZone instead of int for creating datetime

closes #461
This commit is contained in:
Nabeel S 2019-12-09 22:11:20 -05:00 committed by GitHub
parent 8cb0021b9f
commit d9a1e6aba7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -59,7 +59,7 @@ class CronService extends Service
*/
public function updateLastRunTime()
{
$dt = new DateTime('now', DateTimeZone::UTC);
$dt = new DateTime('now', new DateTimeZone('UTC'));
$this->kvpRepo->save('cron_last_run', $dt->format(DateTime::ISO8601));
}
@ -78,7 +78,7 @@ class CronService extends Service
try {
$dt = DateTime::createFromFormat(DateTime::ISO8601, $last_run);
$dt_now = new DateTime('now', DateTimeZone::UTC);
$dt_now = new DateTime('now', new DateTimeZone('UTC'));
} catch (Exception $e) {
Log::error('Error checking for cron problem: '.$e->getMessage());
return true;