V2bX/common/systime/time_unix.go

15 lines
226 B
Go
Raw Normal View History

2023-07-22 06:57:34 -04:00
//go:build linux || darwin
package systime
import (
"time"
"golang.org/x/sys/unix"
)
func SetSystemTime(nowTime time.Time) error {
timeVal := unix.NsecToTimeval(nowTime.UnixNano())
return unix.Settimeofday(&timeVal)
}