cal

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TIME_DATE      string = "2006-01-02"
	TIME_COMMON    string = "2006-01-02 15:04:05"
	TIME_SHORTDATE string = "20060102"

	TIME_TO_DAYS    int = 1
	TIME_TO_HOURS   int = 2
	TIME_TO_MINUTES int = 3
	TIME_TO_SECONDS int = 4
)

Variables

This section is empty.

Functions

func DayListBetweenStartEnd added in v0.1.4

func DayListBetweenStartEnd(start, end string) ([]string, error)

func GetCidrIpRange

func GetCidrIpRange(cidr string) (first string, broadcast string)

func GetDiffTime

func GetDiffTime(previousTime, laterTime interface{}, flag int) (int64, error)

GetDiffTime get the diff time from previous to later time GetDiffTime 获取时间之间的天数,小时数, 分钟数和秒数 parameter previousTime, should be string or time.Time parameter laterTime, should be string or time.Time parameter flag, value is TIME_TO_DAYS,TIME_TO_HOURS, TIME_TO_MINUTES, TIME_TO_SECONDS

func GetFirstAndLastDateOfWeek

func GetFirstAndLastDateOfWeek(date time.Time) (weekMonday, weekSunday string)

GetFirstAndLastDateOfWeek 获取当天所在周的周一和周日时间

func LenToSubNetMask

func LenToSubNetMask(subnet int) string

LenToSubNetMask 如 24 对应的子网掩码地址为 255.255.255.0

func SubNetMaskToLen

func SubNetMaskToLen(netmask string) (int, error)

SubNetMaskToLen 如 255.255.255.0 对应的网络位长度为 24

func UnixTimeStamp2TimeStr

func UnixTimeStamp2TimeStr(sec int64) string

Types

This section is empty.

Jump to

Keyboard shortcuts

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