timeutils

package
v1.5.11 Latest Latest
Warning

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

Go to latest
Published: May 15, 2024 License: GPL-3.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DiffNatureDays

func DiffNatureDays(t1str string, t2str string) int

DiffNatureDays 计算两个时间相差的天数

func FormatLocalDateOnly

func FormatLocalDateOnly(t *time.Time) string

FormatLocalDateOnly 将time.Time转化为日期格式

func FormatLocalDateTime

func FormatLocalDateTime(t *time.Time) string

FormatLocalDateTime 将time.Time转化为日期时间格式

func FormatNowDateOnly

func FormatNowDateOnly() string

FormatNowDateOnly 将当前时间转化为日期格式

func FormatNowDateTime

func FormatNowDateTime() string

FormatNowDateTime 将当前时间转化为日期时间格式

func GetChinaMonth

func GetChinaMonth(t *time.Time) string

GetChinaMonth 获取中文表示的年

func GetChinaWeek

func GetChinaWeek(t *time.Time) string

GetChinaWeek 获取中文表示的星期

func GetWeek

func GetWeek(t *time.Time) int

GetWeek 获取time.Time的星期

func GetYear

func GetYear(t *time.Time) int

GetYear 获取time.Time的年

func ParseLocalDateOnly

func ParseLocalDateOnly(date string) *time.Time

ParseLocalDateOnly 将日期字符串转换为time.Time,dateTime参数如果不是日期字符串会panic

func ParseLocalDateTime

func ParseLocalDateTime(dateTime string) *time.Time

ParseLocalDateTime 将日期时间字符串转换为time.Time,dateTime参数如果不是日期时间字符串会panic

func ParseNowDateOnly

func ParseNowDateOnly() *time.Time

ParseNowDateOnly 将当前时间转换为time.Time,仅有日期信息

Types

This section is empty.

Jump to

Keyboard shortcuts

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