mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
time: rename to_local_time() to local(); time.offset()
This commit is contained in:
@ -418,3 +418,10 @@ pub fn (d Duration) hours() f64 {
|
||||
nsec := d % hour
|
||||
return f64(hr) + f64(nsec) / (60 * 60 * 1e9)
|
||||
}
|
||||
|
||||
// offset returns time zone UTC offset in seconds
|
||||
pub fn offset() int {
|
||||
t := now()
|
||||
local := t.local()
|
||||
return int(local.unix - t.unix)
|
||||
}
|
||||
|
Reference in New Issue
Block a user