File tree Expand file tree Collapse file tree 2 files changed +7
-7
lines changed Expand file tree Collapse file tree 2 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -63,6 +63,6 @@ impl Time {
63
63
fn to_time ( self ) -> time:: OffsetDateTime {
64
64
time:: OffsetDateTime :: from_unix_timestamp ( self . seconds_since_unix_epoch as i64 )
65
65
. expect ( "always valid unix time" )
66
- . replace_offset ( time:: UtcOffset :: from_whole_seconds ( self . offset_in_seconds ) . expect ( "valid offset" ) )
66
+ . to_offset ( time:: UtcOffset :: from_whole_seconds ( self . offset_in_seconds ) . expect ( "valid offset" ) )
67
67
}
68
68
}
Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ use time::macros::format_description;
6
6
7
7
#[ test]
8
8
fn short ( ) {
9
- assert_eq ! ( time( ) . format( format:: SHORT ) , "1973-11-29 " ) ;
9
+ assert_eq ! ( time( ) . format( format:: SHORT ) , "1973-11-30 " ) ;
10
10
}
11
11
12
12
#[ test]
@@ -25,32 +25,32 @@ fn raw() {
25
25
26
26
#[ test]
27
27
fn iso8601 ( ) {
28
- assert_eq ! ( time( ) . format( format:: ISO8601 ) , "1973-11-29 21:33 :09 +0230" ) ;
28
+ assert_eq ! ( time( ) . format( format:: ISO8601 ) , "1973-11-30 00:03 :09 +0230" ) ;
29
29
}
30
30
31
31
#[ test]
32
32
fn iso8601_strict ( ) {
33
- assert_eq ! ( time( ) . format( format:: ISO8601_STRICT ) , "1973-11-29T21:33 :09+02:30" ) ;
33
+ assert_eq ! ( time( ) . format( format:: ISO8601_STRICT ) , "1973-11-30T00:03 :09+02:30" ) ;
34
34
}
35
35
36
36
#[ test]
37
37
fn rfc2822 ( ) {
38
- assert_eq ! ( time( ) . format( format:: RFC2822 ) , "Thu, 29 Nov 1973 21:33 :09 +0230" ) ;
38
+ assert_eq ! ( time( ) . format( format:: RFC2822 ) , "Fri, 30 Nov 1973 00:03 :09 +0230" ) ;
39
39
}
40
40
41
41
#[ test]
42
42
fn default ( ) {
43
43
assert_eq ! (
44
44
time( ) . format( git_date:: time:: format:: DEFAULT ) ,
45
- "Thu Nov 29 1973 21:33 :09 +0230"
45
+ "Fri Nov 30 1973 00:03 :09 +0230"
46
46
) ;
47
47
}
48
48
49
49
#[ test]
50
50
fn custom_compile_time ( ) {
51
51
assert_eq ! (
52
52
time( ) . format( format_description!( "[year]-[month]-[day] [hour]:[minute]:[second]" ) ) ,
53
- "1973-11-29 21:33 :09" ,
53
+ "1973-11-30 00:03 :09" ,
54
54
) ;
55
55
}
56
56
You can’t perform that action at this time.
0 commit comments