Commit 08697a77 authored by David Schreck's avatar David Schreck

importing DateTime and DateTimeZone from the global namespace

parent 289ec4c5
......@@ -2,6 +2,8 @@
use Illuminate\Auth\Passwords\DatabaseTokenRepository as BaseDatabaseTokenRepository;
use MongoDB\BSON\UTCDateTime;
use \DateTime;
use \DateTimeZone;
class DatabaseTokenRepository extends BaseDatabaseTokenRepository
{
......@@ -28,7 +30,7 @@ class DatabaseTokenRepository extends BaseDatabaseTokenRepository
// Convert UTCDateTime to a date string.
if ($token['created_at'] instanceof UTCDateTime) {
$date = $token['created_at']->toDateTime();
$date->setTimezone(new \DateTimeZone(date_default_timezone_get()));
$date->setTimezone(new DateTimeZone(date_default_timezone_get()));
$token['created_at'] = $date->format('Y-m-d H:i:s');
} elseif (is_array($token['created_at']) and isset($token['created_at']['date'])) {
$date = new DateTime($token['created_at']['date'], new DateTimeZone(isset($token['created_at']['timezone']) ? $token['created_at']['timezone'] : 'UTC'));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment