timeutil

package
v8.0.7 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2024 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Datetime14Layout      = "20060102150405"
	Datetime8Layout       = "20060102"
	Datetime6Layout       = "200601"
	YYYYMMDDHHMMSS_LAYOUT = "2006-01-02 15:04:05"
	YYYYMMDDHHMM_LAYOUT   = "2006-01-02 15:04"
	YYYYMMDD_LAYOUT       = "2006-01-02"
)

Variables

View Source
var (
	ShangHaiLOC, _ = time.LoadLocation("Asia/Shanghai")
	EmptyTime, _   = time.Parse("2006-01-02 15:04:05 Z0700 MST", "1979-11-30 00:00:00 +0000 GMT")
)

Functions

func ComputeEndTime

func ComputeEndTime(times int, unit string) time.Time

func FmtDateString

func FmtDateString(t time.Time) string

yy-MM-dd 年-月-日

func FmtDatetime14String

func FmtDatetime14String(t time.Time) string

yyyyMMddhhmmss 年月日时分秒

func FmtDatetime6String

func FmtDatetime6String(t time.Time) string

yyyyMM 年月

func FmtDatetime8String

func FmtDatetime8String(t time.Time) string

yyyyMMdd 年月日

func FmtDatetimeMString

func FmtDatetimeMString(t time.Time) string

yyyy-MM-dd hh:mm 年-月-日 时:分

func FmtDatetimeString

func FmtDatetimeString(t time.Time) string

yyyy-MM-dd hh:mm:ss 年-月-日 时:分:秒

func ParseTimeDesc

func ParseTimeDesc(timestr string) string

Types

type LocalTime

type LocalTime time.Time

func (LocalTime) MarshalCSV

func (t LocalTime) MarshalCSV() (string, error)

func (LocalTime) MarshalJSON

func (t LocalTime) MarshalJSON() ([]byte, error)

func (*LocalTime) MarshalParam

func (t *LocalTime) MarshalParam() string

func (*LocalTime) UnmarshalJSON

func (t *LocalTime) UnmarshalJSON(data []byte) (err error)

func (*LocalTime) UnmarshalParam

func (t *LocalTime) UnmarshalParam(src string) error

Jump to

Keyboard shortcuts

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