timeutil

package
v1.1.6 Latest Latest
Warning

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

Go to latest
Published: Jan 2, 2020 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InferSystemTZ

func InferSystemTZ() string

InferSystemTZ reads system timezone from `TZ`, the path of the soft link of `/etc/localtime`. If both of them are failed, system timezone will be set to `UTC`. It is exported because we need to use it during bootstap stage. And it should be only used at that stage.

func LoadLocation

func LoadLocation(name string) (*time.Location, error)

LoadLocation loads time.Location by IANA timezone time.

func SetSystemTZ

func SetSystemTZ(name string)

SetSystemTZ sets systemTZ by the value loaded from mysql.tidb.

func SystemLocation

func SystemLocation() *time.Location

SystemLocation returns time.SystemLocation's IANA timezone location. It is TiDB's global timezone location.

func Zone

func Zone(loc *time.Location) (string, int64)

Zone returns the current timezone name and timezone offset in seconds. In compatible with MySQL, we change `SystemLocation` to `System`.

Types

This section is empty.

Jump to

Keyboard shortcuts

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