mirror of
https://github.com/containers/podman.git
synced 2025-09-17 06:47:10 +08:00

Added an option to podman machine init to declare the timezone of the resulting machine. the default is to use the value of the host name or else a given timezone name like America/Chicago. Fixes: #11895 Signed-off-by: Brent Baude <bbaude@redhat.com> [NO NEW TESTS NEEDED] Signed-off-by: Brent Baude <bbaude@redhat.com>
17 lines
259 B
Go
17 lines
259 B
Go
//+build darwin
|
|
|
|
package machine
|
|
|
|
import (
|
|
"os"
|
|
"strings"
|
|
)
|
|
|
|
func getLocalTimeZone() (string, error) {
|
|
tzPath, err := os.Readlink("/etc/localtime")
|
|
if err != nil {
|
|
return "", err
|
|
}
|
|
return strings.TrimPrefix(tzPath, "/var/db/timezone/zoneinfo"), nil
|
|
}
|