Skip to content

Commit

Permalink
Fix timezone issue in unittest test_naive_date_time_param and test_da…
Browse files Browse the repository at this point in the history
…te_time_param
  • Loading branch information
jason-ni committed Apr 25, 2023
1 parent 80a492c commit 73e1fd7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/types/chrono.rs
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ mod test {
let db = checked_memory_handle()?;
let result: Result<bool> = db.query_row(
"SELECT 1 WHERE ? BETWEEN (now()::timestamp - INTERVAL '1 minute') AND (now()::timestamp + INTERVAL '1 minute')",
[Utc::now().naive_utc()],
[Local::now().naive_local()],
|r| r.get(0),
);
assert!(result.is_ok());
Expand All @@ -262,7 +262,7 @@ mod test {
let db = checked_memory_handle()?;
// TODO(wangfenjin): why need 2 params?
let result: Result<bool> = db.query_row(
"SELECT 1 WHERE ? BETWEEN (now()::timestamp - INTERVAL '1 minute') AND (now()::timestamp + INTERVAL '1 minute')",
"SELECT 1 WHERE ? BETWEEN (now()::timestamptz - INTERVAL '1 minute') AND (now()::timestamptz + INTERVAL '1 minute')",
[Utc::now()],
|r| r.get(0),
);
Expand Down

0 comments on commit 73e1fd7

Please sign in to comment.