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:
@@ -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();
|
||||
|
||||
|
Reference in New Issue
Block a user