File tree Expand file tree Collapse file tree 3 files changed +6
-18
lines changed Expand file tree Collapse file tree 3 files changed +6
-18
lines changed Original file line number Diff line number Diff line change @@ -14,10 +14,6 @@ pub fn utc_now() -> chrono::DateTime<chrono::Utc> {
14
14
let now = std:: time:: SystemTime :: now ( )
15
15
. duration_since ( std:: time:: UNIX_EPOCH )
16
16
. expect ( "system time before Unix epoch" ) ;
17
- let naive = chrono:: NaiveDateTime :: from_timestamp_opt (
18
- now. as_secs ( ) as i64 ,
19
- now. subsec_nanos ( ) ,
20
- )
21
- . unwrap ( ) ;
22
- chrono:: DateTime :: from_naive_utc_and_offset ( naive, chrono:: Utc )
17
+ chrono:: DateTime :: from_timestamp ( now. as_secs ( ) as i64 , now. subsec_nanos ( ) )
18
+ . unwrap ( )
23
19
}
Original file line number Diff line number Diff line change @@ -10,10 +10,6 @@ pub fn utc_now() -> chrono::DateTime<chrono::Utc> {
10
10
let now = std:: time:: SystemTime :: now ( )
11
11
. duration_since ( std:: time:: UNIX_EPOCH )
12
12
. expect ( "system time before Unix epoch" ) ;
13
- let naive = chrono:: NaiveDateTime :: from_timestamp_opt (
14
- now. as_secs ( ) as i64 ,
15
- now. subsec_nanos ( ) ,
16
- )
17
- . unwrap ( ) ;
18
- chrono:: DateTime :: from_naive_utc_and_offset ( naive, chrono:: Utc )
13
+ chrono:: DateTime :: from_timestamp ( now. as_secs ( ) as i64 , now. subsec_nanos ( ) )
14
+ . unwrap ( )
19
15
}
Original file line number Diff line number Diff line change @@ -10,10 +10,6 @@ pub fn utc_now() -> chrono::DateTime<chrono::Utc> {
10
10
let now = std:: time:: SystemTime :: now ( )
11
11
. duration_since ( std:: time:: UNIX_EPOCH )
12
12
. expect ( "system time before Unix epoch" ) ;
13
- let naive = chrono:: NaiveDateTime :: from_timestamp_opt (
14
- now. as_secs ( ) as i64 ,
15
- now. subsec_nanos ( ) ,
16
- )
17
- . unwrap ( ) ;
18
- chrono:: DateTime :: from_naive_utc_and_offset ( naive, chrono:: Utc )
13
+ chrono:: DateTime :: from_timestamp ( now. as_secs ( ) as i64 , now. subsec_nanos ( ) )
14
+ . unwrap ( )
19
15
}
You can’t perform that action at this time.
0 commit comments