zoneinfo

package
v0.0.0-...-520a03a Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2021 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (

	// Error, invalid timezone
	ErrZoneInvalid = fmt.Errorf("Invalid time zone")
)

Functions

func GetAllZones

func GetAllZones() []string

func IsZoneValid

func IsZoneValid(zone string) bool

Check timezone validity

Types

type DSTInfo

type DSTInfo struct {
	// The timestamp of entering DST every year
	Enter int64
	// The timestamp of leaving DST every year
	Leave int64

	// The DST offset
	Offset int32
}

type ZoneInfo

type ZoneInfo struct {
	// Timezone name, ex: "Asia/Shanghai"
	Name string
	// Timezone description, ex: "上海"
	Desc string

	// Timezone offset
	Offset int32

	DST DSTInfo
}

func GetZoneInfo

func GetZoneInfo(zone string) (*ZoneInfo, error)

Query timezone detail info by timezone

Jump to

Keyboard shortcuts

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