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

Function UpdateSystemTimeZone

agent/utils/ntp/ntp.go:74–84  ·  view source on GitHub ↗
(timezone string)

Source from the content-addressed store, hash-verified

72}
73
74func UpdateSystemTimeZone(timezone string) error {
75 system := runtime.GOOS
76 if system == "linux" {
77 cmdMgr := cmd.NewCommandMgr()
78 if err := cmdMgr.RunWithOptionalSudo("timedatectl", "set-timezone", timezone); err != nil {
79 return fmt.Errorf("update system time zone failed, %v", err)
80 }
81 return nil
82 }
83 return fmt.Errorf("the current system architecture %v does not support synchronization", system)
84}

Callers

nothing calls this directly

Calls 1

RunWithOptionalSudoMethod · 0.80

Tested by

no test coverage detected