ctime

package
v0.4.35 Latest Latest
Warning

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

Go to latest
Published: May 29, 2023 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func China

func China() *time.Location

func Format

func Format(t time.Time, layout string) string

func FormatNow

func FormatNow(layout string) string

func Now

func Now() time.Time

Now returns the current time, and set location information to China for display purposes.

func NowString

func NowString() string

NowString 当前时间转换为 200601021504(年月日时分)的格式

func Parse

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

Parse 解析时间字符串(基于 UTC)

func ParseInChina

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

ParseInChina 解析时间字符串(基于 GMT+8)

func TimeFromUnix

func TimeFromUnix(sec int64) time.Time

TimeFromUnix 使用秒级时间戳获取时间对象

func TimeFromUnixMicro

func TimeFromUnixMicro(msec uint64) time.Time

TimeFromUnixMicro 使用微秒级时间戳获取时间对象

func TimeFromUnixNano

func TimeFromUnixNano(nsec uint64) time.Time

TimeFromUnixNano 使用纳秒级时间戳获取时间对象

func TimeString

func TimeString() string

TimeString 当前时间转换为 150405(时分秒)的格式

func ToChina

func ToChina(t time.Time) time.Time

func TodayString

func TodayString() string

TodayString 当前时间转换为 20060102(年月日)的格式

Types

This section is empty.

Jump to

Keyboard shortcuts

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