xtime

package
v1.1.6 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2022 License: MIT Imports: 2 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Duration

func Duration(str string) time.Duration

Duration wraps time.ParseDuration but do panic when parse duration occurs.

func ParseInLocation

func ParseInLocation(layout, value string) (time.Time, error)

ParseInLocation parses time with location from env "TZ", if "TZ" hasn't been set then we use UTC by default.

Types

type TimeFormat

type TimeFormat string

TimeFormat ... Deprecated: this function will be moved to internal package, user should not use it any more.

var TS TimeFormat = "2006-01-02 15:04:05"

TS RFC 3339 with seconds Deprecated: this function will be moved to internal package, user should not use it any more.

func (TimeFormat) Format

func (ts TimeFormat) Format(t time.Time) string

Format 格式化 Deprecated: this function will be moved to internal package, user should not use it any more.

Jump to

Keyboard shortcuts

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