1
0
mirror of https://github.com/fafhrd91/actix-web synced 2025-07-10 04:46:00 +02:00

actix-http: update time to 0.2.7

This commit is contained in:
Yuki Okushi
2020-02-23 07:09:00 +09:00
parent f9f9fb4c84
commit c8ccc69b93
6 changed files with 15 additions and 15 deletions

View File

@ -1,4 +1,4 @@
use time::{PrimitiveDateTime, Date};
use time::{OffsetDateTime, PrimitiveDateTime, Date};
/// Attempt to parse a `time` string as one of either RFC 1123, RFC 850, or asctime.
pub fn parse_http_date(time: &str) -> Option<PrimitiveDateTime> {
@ -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 = PrimitiveDateTime::now();
let now = OffsetDateTime::now();
let century_start_year = (now.year() / 100) * 100;
let mut expanded_year = century_start_year + dt.year();