Skip to content

Commit 7434d93

Browse files
committed
deprecated
1 parent c0b5882 commit 7434d93

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

tokio-postgres/tests/test/types/chrono_04.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use chrono_04::{DateTime, NaiveDate, NaiveDateTime, NaiveTime, TimeZone, Utc};
1+
use chrono_04::{DateTime, NaiveDate, NaiveDateTime, NaiveTime, Utc};
22
use std::fmt;
33
use tokio_postgres::types::{Date, FromSqlOwned, Timestamp};
44
use tokio_postgres::Client;
@@ -53,10 +53,10 @@ async fn test_with_special_naive_date_time_params() {
5353
async fn test_date_time_params() {
5454
fn make_check(time: &str) -> (Option<DateTime<Utc>>, &str) {
5555
(
56-
Some(
57-
Utc.datetime_from_str(time, "'%Y-%m-%d %H:%M:%S.%f'")
58-
.unwrap(),
59-
),
56+
Some(DateTime::from_naive_utc_and_offset(
57+
NaiveDateTime::parse_from_str(time, "'%Y-%m-%d %H:%M:%S.%f'").unwrap(),
58+
Utc,
59+
)),
6060
time,
6161
)
6262
}
@@ -76,10 +76,10 @@ async fn test_date_time_params() {
7676
async fn test_with_special_date_time_params() {
7777
fn make_check(time: &str) -> (Timestamp<DateTime<Utc>>, &str) {
7878
(
79-
Timestamp::Value(
80-
Utc.datetime_from_str(time, "'%Y-%m-%d %H:%M:%S.%f'")
81-
.unwrap(),
82-
),
79+
Timestamp::Value(DateTime::from_naive_utc_and_offset(
80+
NaiveDateTime::parse_from_str(time, "'%Y-%m-%d %H:%M:%S.%f'").unwrap(),
81+
Utc,
82+
)),
8383
time,
8484
)
8585
}

0 commit comments

Comments
 (0)