timezone

package
v0.0.0-...-ffb386f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 17, 2024 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultTimezone is the default timezone string
	// This is what is set in os-core
	DefaultTimezone = "UTC"

	// RequiredBundle the bundle needed to set timezone other than the default
	RequiredBundle = "tzdata"
)

Variables

This section is empty.

Functions

func IsValidTimezone

func IsValidTimezone(t *TimeZone) bool

IsValidTimezone verifies if the given keyboard is valid

func SetTargetTimezone

func SetTargetTimezone(rootDir string, timezone string) error

SetTargetTimezone uses creates a symlink to set the timezone on the target

Types

type TimeZone

type TimeZone struct {
	Code string
	// contains filtered or unexported fields
}

TimeZone represents the system time zone

func Load

func Load() ([]*TimeZone, error)

Load uses timedatectl to load the currently available timezones

func (*TimeZone) Equals

func (tz *TimeZone) Equals(comp *TimeZone) bool

Equals compares tow Timezone instances

func (*TimeZone) IsUserDefined

func (tz *TimeZone) IsUserDefined() bool

IsUserDefined returns true if the configuration was interactively defined by the user

func (*TimeZone) MarshalYAML

func (tz *TimeZone) MarshalYAML() (interface{}, error)

MarshalYAML marshals TimeZone into YAML format

func (*TimeZone) UnmarshalYAML

func (tz *TimeZone) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML unmarshals TimeZone from YAML format

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL