mirror of
https://gitclone.com/github.com/MetaCubeX/Clash.Meta
synced 2024-11-14 21:31:16 +08:00
15 lines
222 B
Go
15 lines
222 B
Go
//go:build linux || darwin
|
|
|
|
package ntp
|
|
|
|
import (
|
|
"time"
|
|
|
|
"golang.org/x/sys/unix"
|
|
)
|
|
|
|
func setSystemTime(nowTime time.Time) error {
|
|
timeVal := unix.NsecToTimeval(nowTime.UnixNano())
|
|
return unix.Settimeofday(&timeVal)
|
|
}
|