src/Driver/Driver.php
protected function formatDatetime(\DateTimeInterface $value): string
    {
        try {
            $datetime = new \DateTimeImmutable('now', $this->getTimezone());
        } catch (\Exception $e) {
            throw new DriverException($e->getMessage(), $e->getCode(), $e);
        }

        return $datetime->setTimestamp($value->getTimestamp())->format(static::DATETIME);
    }
protected function formatDatetime(\DateTimeInterface $value): string
    {
        try {
            $datetime = new \DateTimeImmutable('now', $this->getTimezone());
        } catch (\Exception $e) {
            throw new DriverException($e->getMessage(), $e->getCode(), $e);
        }

        return $datetime->setTimestamp($value->getTimestamp())->format(static::DATETIME);
    }
protected function formatDatetime ( \ DateTimeInterface $ value ) : string { try { $ datetime = new \ DateTimeImmutable ( 'now' , $ this -> getTimezone ( ) ) ; } catch ( \ Exception $ e ) { throw new DriverException ( $ e -> getMessage ( ) , $ e -> getCode ( ) , $ e ) ; } return $ datetime -> setTimestamp ( $ value -> getTimestamp ( ) ) -> format ( static :: DATETIME ) ; }
Convert DateTime object into local database representation. Driver will automatically force
needed timezone.

@param \DateTimeInterface $value
@return string

@throws DriverException
Convert DateTime object into local database representation . Driver will automatically force needed timezone .