mirror of
https://github.com/SagerNet/sing-box.git
synced 2024-11-16 16:22:22 +08:00
15 lines
227 B
Go
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)
|
||
|
}
|