times

package
v0.0.0-...-6302c98 Latest Latest
Warning

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

Go to latest
Published: May 8, 2024 License: MIT Imports: 5 Imported by: 2

Documentation

Index

Constants

View Source
const (

	// MinuteSecond 一分钟的秒数
	MinuteSecond = 60
	// HourSecond 一小时的秒数
	HourSecond = MinuteSecond * 60
	// DaySecond 一天的秒数
	DaySecond = HourSecond * 24
)

Variables

This section is empty.

Functions

func FormatDate

func FormatDate(t time.Time) string

func FormatDateByTypes

func FormatDateByTypes(t types.Time) string

func FormatTime

func FormatTime(t time.Time) string

func FormatTimeByTypes

func FormatTimeByTypes(t types.Time) string

func GetBeiJingTime

func GetBeiJingTime() time.Time

func GetDateInt

func GetDateInt(t types.Time) int

func GetDateIntByTime

func GetDateIntByTime(t time.Time) int

func GetDateTimeLong

func GetDateTimeLong(t types.Time) int64

func GetDateTimeLongByTime

func GetDateTimeLongByTime(t time.Time) int64

func GetDateTimeMillisecondStrByMillisecond

func GetDateTimeMillisecondStrByMillisecond(ms int64) string

func GetDateTimeStrByMillisecond

func GetDateTimeStrByMillisecond(ms int64) string

func GetDateTimeStrBySecond

func GetDateTimeStrBySecond(s int64) string

func GetLastMonth1Date

func GetLastMonth1Date(t time.Time) time.Time

GetLastMonth1Date 获取时间上个月1号0时0分0秒时间

func GetLastMonthDayCount

func GetLastMonthDayCount(t time.Time) int64

getLastMonthDayCount 获取时间上个月的天数

func GetLastMonthLastDate

func GetLastMonthLastDate(t time.Time) time.Time

GetLastMonthLastDate 获取时间上个月的最后一天0时0分0秒时间

func GetMillisecond

func GetMillisecond(t time.Time) int64

func GetMonthLastDay

func GetMonthLastDay(t time.Time) time.Time

GetMonthLastDay 获取传入日期月的最后一天

func GetMonthStart

func GetMonthStart(d time.Time) time.Time

GetMonthStart 获取传入的时间所在月份的第一天,即某月第一天的0点。如传入time.Now(), 返回当前月份的第一天0点时间。

func GetNowMillisecond

func GetNowMillisecond() int64

func GetNowMonth1Date

func GetNowMonth1Date(t time.Time) time.Time

GetLastMonth1Date 获取时间当月1号0时0分0秒时间

func GetNowNanoSecond

func GetNowNanoSecond() int64

func GetNowSecond

func GetNowSecond() int64

func GetTodayTimeQuantum

func GetTodayTimeQuantum() []time.Time

获取当天时间段:2019-08-12 00:00:00 - 2019-08-12 23:59:59

func GetUnixTime

func GetUnixTime(t types.Time) int64

func GetWeeHours

func GetWeeHours() string

func GetWeekStart

func GetWeekStart(d time.Time) time.Time

GetWeekStart 获取某一天当前周的周一0点

func GetYesterdayDate

func GetYesterdayDate() string

2019-09-03

func GetZeroTime

func GetZeroTime(d time.Time) time.Time

GetZeroTime 获取某一天的0点时间

func Parse

func Parse(str string) (time.Time, errors.AppError)

func ParseByFormat

func ParseByFormat(format, str string) (time.Time, errors.AppError)

func ParseTime

func ParseTime(str string) (types.Time, errors.AppError)

func Sleep

func Sleep(second int64)

func SleepMillisecond

func SleepMillisecond(millSecond int64)

Types

This section is empty.

Jump to

Keyboard shortcuts

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