MCPcopy Create free account
hub / github.com/1Panel-dev/1Panel / UpdateSystemTime

Function UpdateSystemTime

agent/utils/ntp/ntp.go:62–72  ·  view source on GitHub ↗
(dateTime string)

Source from the content-addressed store, hash-verified

60}
61
62func UpdateSystemTime(dateTime string) error {
63 system := runtime.GOOS
64 if system == "linux" {
65 cmdMgr := cmd.NewCommandMgr()
66 if err := cmdMgr.RunWithOptionalSudo("date", "-s", dateTime); err != nil {
67 return fmt.Errorf("update system time failed, %v", err)
68 }
69 return nil
70 }
71 return fmt.Errorf("the current system architecture %v does not support synchronization", system)
72}
73
74func UpdateSystemTimeZone(timezone string) error {
75 system := runtime.GOOS

Callers

nothing calls this directly

Calls 1

RunWithOptionalSudoMethod · 0.80

Tested by

no test coverage detected