-
I am using Phalcon 5.0.0RC4. There is no problem in the local test environment, but in the production environment only the time zone of the database is UTC and cannot be changed. |
Beta Was this translation helpful? Give feedback.
Answered by
niden
Sep 11, 2022
Replies: 1 comment 1 reply
-
You can do it when registering your database provider. $container->setShared(
'db',
function () {
$options = [
'host' => envValue('DATA_API_MYSQL_HOST', 'localhost'),
'username' => envValue('DATA_API_MYSQL_USER', 'phalcon'),
'password' => envValue('DATA_API_MYSQL_PASS', ''),
'dbname' => envValue('DATA_API_MYSQL_NAME', 'phalcon_api'),
];
$connection = new Mysql($options);
// Set everything to UTF8
$connection->execute('SET NAMES utf8mb4', []);
// Set time to UTC
$connection->execute("SET time_zone='+9:00'", []);
return $connection;
}
); |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
s-ohnishi
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You can do it when registering your database provider.