mirror of
https://github.com/DNSCrypt/dnscrypt-proxy.git
synced 2025-03-04 10:24:40 +01:00
20 lines
324 B
Go
20 lines
324 B
Go
package main
|
|
|
|
import (
|
|
"os/exec"
|
|
"strings"
|
|
"time"
|
|
)
|
|
|
|
func TimezoneSetup() error {
|
|
out, err := exec.Command("/system/bin/getprop", "persist.sys.timezone").Output()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
z, err := time.LoadLocation(strings.TrimSpace(string(out)))
|
|
if err != nil {
|
|
return err
|
|
}
|
|
time.Local = z
|
|
return nil
|
|
}
|