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

time: fix date parsing tests in winter for regions using DST (#7304)

This commit is contained in:
Uwe Krüger
2020-12-14 05:01:58 +01:00
committed by GitHub
parent b9bf7a6583
commit 591e523cf3
5 changed files with 15 additions and 8 deletions

View File

@@ -24,7 +24,7 @@ fn make_unix_time(t C.tm) int {
return int(C.timegm(&t))
}
fn to_local_time(t Time) Time {
pub fn (t Time) to_local_time() Time {
loc_tm := C.tm{}
C.localtime_r(time_t(&t.unix), &loc_tm)
return convert_ctime(loc_tm, t.microsecond)