sing-box/common/settings/time_unix.go
2023-03-18 23:11:40 +08:00

15 lines
227 B
Go

//go:build linux || darwin
package settings
import (
"time"
"golang.org/x/sys/unix"
)
func SetSystemTime(nowTime time.Time) error {
timeVal := unix.NsecToTimeval(nowTime.UnixNano())
return unix.Settimeofday(&timeVal)
}