time

package
v0.0.0-...-ff4890a Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2024 License: MIT, Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Date

func Date(timestamp int64, timeLayout string) string

Date PHP格式化时间 timestamp=0 默认为当前时间

func Diff

func Diff(time1, time2 time.Time) (year, month, day, hour, minute, second int)

Diff 比较两个格式一样的时间的时间差

func FormatRfcToLayout

func FormatRfcToLayout(rfcTime, layout string) (string, error)

FormatRfcToLayout rfc时间格式化成指定的格式

func NewDateTime

func NewDateTime(dateTime, timeLayout string) time.Time

NewDateTime 创建一个时间Time

func RfcToLocalDatetime

func RfcToLocalDatetime(rfcTime string) (string, error)

RfcToLocalDatetime rfc时间格式转成Y-m-d H:i:s rfc格式:2003-10-30T00:00:00+08:00字符串

func StrToTime

func StrToTime(datetime, timeLayout string) int64

StrToTime PHP时间字符串转时间戳

func Time

func Time() int64

Time PHP获取当前时间戳

Types

This section is empty.

Jump to

Keyboard shortcuts

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