1
0
mirror of https://github.com/fafhrd91/actix-web synced 2025-07-24 17:55:27 +02:00

Replace deprecated now with now_utc (#1481)

* Replace deprecated now with now_utc

* Update doctest
This commit is contained in:
Mikail Bagishov
2020-05-02 12:14:50 +03:00
committed by GitHub
parent c27d3fad8e
commit d5ceae2074
6 changed files with 13 additions and 13 deletions

View File

@@ -19,7 +19,7 @@ fn try_parse_rfc_850(time: &str) -> Option<PrimitiveDateTime> {
// If the `time` string contains a two-digit year, then as per RFC 2616 § 19.3,
// we consider the year as part of this century if it's within the next 50 years,
// otherwise we consider as part of the previous century.
let now = OffsetDateTime::now();
let now = OffsetDateTime::now_utc();
let century_start_year = (now.year() / 100) * 100;
let mut expanded_year = century_start_year + dt.year();