tidb: github.com/pingcap/tidb/util/timeutil Index | Files

package timeutil

import "github.com/pingcap/tidb/util/timeutil"

Index

Package Files

time.go

func InferSystemTZ Uses

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 Uses

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

LoadLocation loads time.Location by IANA timezone time.

func SetSystemTZ Uses

func SetSystemTZ(name string)

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

func SystemLocation Uses

func SystemLocation() *time.Location

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

func Zone Uses

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`.

Package timeutil imports 9 packages (graph) and is imported by 25 packages. Updated 2019-07-04. Refresh now. Tools for package owners.