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:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user