dateutil

package
v0.4.7 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DateTimeStr = "YYYY-MM-DD hh:mm:ss"
	DateStr     = "YYYY-MM-DD"
)

Variables

This section is empty.

Functions

func CompareDate

func CompareDate(date1, date2 time.Time) int

func DayAddOrSub

func DayAddOrSub(t time.Time, num int64) time.Time

DayAddOrSub 时间天加减计算

func FormatToString

func FormatToString(t time.Time, s string) string

FormatToString 时间格式化成字符串 Time forms a string

func GetWeekDay

func GetWeekDay(t time.Time) int

GetWeekDay 获取周几方法 How to get the day of the week

func HourAddOrSub

func HourAddOrSub(t time.Time, num int64) time.Time

HourAddOrSub 时间小时加减计算

func InterpretStringToTimestamp

func InterpretStringToTimestamp(timeStr string, strFormat string) (int64, error)

InterpretStringToTimestamp String to timestamp 字符串转时间戳

func IsZero

func IsZero(t time.Time) bool

IsZero 判断时间是否为零 Determine whether the time is zero

func MinuteAddOrSub

func MinuteAddOrSub(t time.Time, num int64) time.Time

MinuteAddOrSub 时间分钟加减计算

func Now

func Now() time.Time

Now 获取当前时间 Get the current time

func StrToDate

func StrToDate(timeStr string, s string) (time.Time, error)

func UnixToTime

func UnixToTime(unix int64) time.Time

UnixToTime 时间戳转时间 UnixToTime timestamp to time

Types

type Date

type Date struct {
}

Jump to

Keyboard shortcuts

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