xtime

package
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2024 License: MIT Imports: 2 Imported by: 14

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 added in v0.3.4

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

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

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

Jump to

Keyboard shortcuts

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