A zend-db extension.
At the root of your project type
composer require phpfacile/zend-db-ext
Or add "phpfacile/zend-db-ext": "^1.0" to the "require" part of your composer.json file
"require": {
"phpfacile/zend-db-ext": "^1.0"
}
use PHPFacile\Zend\Db\Helper\ZendDbHelper;
$expression = ZendDbHelper::getUTCTimestampExpression($adapter);
This will return
- new Expression('UTC_TIMESTAMP()'); in case of MySQL
- new Expression('datetime('now')'); in case of SQLite