timelib

package
v1.2.5 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2022 License: Apache-2.0 Imports: 1 Imported by: 0

README

时间处理类

引入类库

字符串转时间

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetCurDayTime

func GetCurDayTime() time.Time

GetCurDayTime 获取当前天的时间戳

func GetFirstDayOfMonth

func GetFirstDayOfMonth(t time.Time) time.Time

GetFirstDayOfMonth 获取月的第一天

func GetLastMonthStartEnd added in v1.2.4

func GetLastMonthStartEnd() (lastMonthStart, lastMonthEnd time.Time)

GetLastMonthStartEnd 获取上个月开始结束时间

func GetWeeksByTime

func GetWeeksByTime(t time.Time) (startWeeks []time.Time)

GetWeeksByTime 根据时间获取周的日期列表

func StrToTime

func StrToTime(layout, value string) (t time.Time)

StrToTime 字符串转时间对象

func SubDays

func SubDays(t1, t2 time.Time) (day int)

SubDays 计算日期相差多少天

func SubMonth

func SubMonth(t1, t2 time.Time) (month int)

SubMonth 计算日期相差多少月

Types

This section is empty.

Jump to

Keyboard shortcuts

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