Closed januwA closed 2 years ago
I'm using diesel, but the timezone is always set wrong every time. I want to set the timezone every time I link
diesel = { version = "1.4.4", features = ["mysql", "r2d2", "chrono", "numeric"] }
like sqlx
let db_pool = web::Data::new( sqlx::mysql::MySqlPoolOptions::new() .max_connections(5) .after_connect(|conn| { Box::pin(async move { conn.execute("set time_zone = '+8:00'").await?; Ok(()) }) }) .connect(&bd_url) .await .expect("链接数据库失败"), );
I set the default time zone in the mysql configuration file, but it still doesn't work after the link
[mysqld] default-time_zone = '+8:00'
all i want to set the timezone on every link
thanks ❤️
This is a question for the developers of the mysql library.
I'm using diesel, but the timezone is always set wrong every time. I want to set the timezone every time I link
like sqlx
I set the default time zone in the mysql configuration file, but it still doesn't work after the link
all i want to set the timezone on every link
thanks ❤️