hztime

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2023 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	GoTimeFmtBaseSimple = "20060102"
	GoTimeFmtBase       = "2006-01-02 15:04:05"
	GoTimeFmtBase1      = "2006/01/02 15:04:05"
)
View Source
const (
	Second = 1
	Minute = 60 * Second // 一分钟的秒数
	Hour   = 60 * Minute // 一小时的秒数
	Day    = 24 * Hour   // 一天的秒数
	Week   = 7 * Day     // 一周的秒数
)

Variables

This section is empty.

Functions

func DateFmt

func DateFmt(dateStr string) time.Time

解析日期文本("20060102")

func DatetimeFmt

func DatetimeFmt(dateStr string) time.Time

解析时间文本("2006-01-02 15:04:05")

func DatetimeFmt1

func DatetimeFmt1(dateStr string) time.Time

解析时间文本("2006/01/02 15:04:05")

func Day0Clock

func Day0Clock(t time.Time) time.Time

Day0Clock 0 o'clock of the specified date and time 指定日期时间的0点

func HourBase

func HourBase(t time.Time) time.Time

HourBase The current hour starting from the specified date and time. 指定日期时间的当前小时开始

func HourBaseUnix

func HourBaseUnix(ts int64) time.Time

HourBaseUnix The current hour starting from the specified timestamp. 指定时间戳的当前小时开始

func Monday0Clock

func Monday0Clock(t time.Time) time.Time

Monday0Clock Monday at 0:00 specified by the timestamp. 指定时间戳所在的周一0点

func Month1st0Clock

func Month1st0Clock(t time.Time) time.Time

Month1st0Clock 1st day of the corresponding month at 0:00 specified time. 指定日期时间对应月份的1号0点

func NowMonday0Clock

func NowMonday0Clock() time.Time

NowMonday0Clock Get the timestamp of 0:00 on Monday of the current week. 当前时间的周一0点

func NowMonth1st0Clock

func NowMonth1st0Clock() time.Time

NowMonth1st0Clock The 1st day of the current month at 0:00. 当前时间的本月1号0点

func NowUponMonth1st0Clock

func NowUponMonth1st0Clock() time.Time

NowUponMonth1st0Clock The 1st day of the current month at 0:00. 当前时间的本月1号0点

func Today0Clock

func Today0Clock() time.Time

Today0Clock 0 o'clock of today 今日0点

func TodayHourBase

func TodayHourBase(h int) time.Time

TodayHourBase Specified hour of the today 今日指定小时时间

func TsCycle0Clock

func TsCycle0Clock(cycle int32, ts int64) uint64

0:day, 1:week, 2:month 默认返回今日0点

func TsDay0Clock

func TsDay0Clock(ts int64) time.Time

TsDay0Clock 0 o'clock of the specified timestamp 指定时间戳的0点

func TsMonday0Clock

func TsMonday0Clock(ts int64) time.Time

TsMonday0Clock Monday at 0:00 of the specified date and time. 指定日期时间所在的周一0点

func TsMonth1st0Clock

func TsMonth1st0Clock(ts int64) time.Time

TsMonth1st0Clock 1st day of the corresponding month at 0:00 specified time. 指定时间戳对应月份的1号0点

func TsUponCycle0Clock

func TsUponCycle0Clock(cycle int32, ts int64) uint64

0:day, 1:week, 2:month 默认返回今日0点

func TsUponMonth1st0Clock

func TsUponMonth1st0Clock(ts int64) time.Time

TsUponMonth1st0Clock 1st day of the corresponding month at 0:00 specified time. 指定时间戳对应月份的1号0点

func UponMonth1st0Clock

func UponMonth1st0Clock(t time.Time) time.Time

UponMonth1st0Clock 1st day of the corresponding month at 0:00 specified time. 指定日期时间对应月份的1号0点

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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