File tree Expand file tree Collapse file tree 2 files changed +23
-9
lines changed Expand file tree Collapse file tree 2 files changed +23
-9
lines changed Original file line number Diff line number Diff line change @@ -8,15 +8,16 @@ module time
8
8
#include <errno.h>
9
9
10
10
pub struct C.tm {
11
- tm_sec int
12
- tm_min int
13
- tm_hour int
14
- tm_mday int
15
- tm_mon int
16
- tm_year int
17
- tm_wday int
18
- tm_yday int
19
- tm_isdst int
11
+ tm_sec int
12
+ tm_min int
13
+ tm_hour int
14
+ tm_mday int
15
+ tm_mon int
16
+ tm_year int
17
+ tm_wday int
18
+ tm_yday int
19
+ tm_isdst int
20
+ tm_gmtoff int
20
21
}
21
22
22
23
fn C.timegm (& C.tm) C.time_t
Original file line number Diff line number Diff line change @@ -344,3 +344,16 @@ fn test_parse_three_letters_month() {
344
344
tm_tm := time.parse_format (tm_s, format)!
345
345
assert tm_tm.month == tm.month
346
346
}
347
+
348
+ fn test_tm_gmtoff () {
349
+ $if windows {
350
+ return
351
+ } $else {
352
+ rawtime := i64 (0 ) // C.time_t{}
353
+
354
+ C.time (& rawtime) // C.tm{}
355
+
356
+ info := C.localtime (& rawtime)
357
+ assert info.tm_gmtoff == time.now ().unix - time.utc ().unix
358
+ }
359
+ }
You can’t perform that action at this time.
0 commit comments