1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

time: fix timezone

This commit is contained in:
vitalyster
2020-02-04 14:17:04 +03:00
committed by GitHub
parent 85e4e4cb40
commit 21b54723e4
4 changed files with 14 additions and 8 deletions

View File

@@ -10,7 +10,6 @@ struct C.tm {
tm_hour int
tm_min int
tm_sec int
//tm_gmtoff int // seconds
}
pub fn convert_ctime(t tm) Time {
@@ -21,7 +20,11 @@ pub fn convert_ctime(t tm) Time {
hour: t.tm_hour
minute: t.tm_min
second: t.tm_sec
unix: C.mktime(&t)
}//.add_seconds(t.tm_gmtoff)
unix: make_unix_time(t)
}
}
[inline]
fn make_unix_time(t tm) int {
return C.mktime(&t) - C._timezone
}