Documentation ¶
Index ¶
- Constants
- Variables
- func AnyPercent(num interface{}, places int, cutoff int) string
- func CeilFloat(f float64, places int) float64
- func DayListBetweenStartEnd(start, end string) ([]string, error)
- func FloorFloat(num float64, places int) float64
- func GetCidrIpRange(cidr string) (first string, broadcast string)
- func GetCurrentAndNextHour(timeStr string) (string, string, error)
- func GetDiffTime(previousTime, laterTime interface{}, flag int) (int64, error)
- func GetFirstAndLastDateOfWeek(date time.Time) (weekMonday, weekSunday string)
- func LenToSubNetMask(subnet int) string
- func Percent(num float64, places int, cutoff int) string
- func PercentVal(num float64, places int, cutoff int) string
- func RoundFloat(num float64, places int) float64
- func SubNetMaskToLen(netmask string) (int, error)
- func Tomorrow(today string) (string, error)
- func UnixTimeStamp2TimeStr(sec int64) string
- func Yesterday(today string) (string, error)
Constants ¶
Variables ¶
View Source
var ( CUT_OFF_CEIL = 2 CUT_OFF_ROUND = 3 CUT_OFF_FLOOR = 4 )
Functions ¶
func AnyPercent ¶ added in v0.1.8
func DayListBetweenStartEnd ¶ added in v0.1.4
func FloorFloat ¶ added in v0.1.6
func GetCidrIpRange ¶
func GetCurrentAndNextHour ¶ added in v0.1.6
func GetDiffTime ¶
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 ¶
GetFirstAndLastDateOfWeek 获取当天所在周的周一和周日时间
func LenToSubNetMask ¶
LenToSubNetMask 如 24 对应的子网掩码地址为 255.255.255.0
func RoundFloat ¶ added in v0.1.6
func SubNetMaskToLen ¶
SubNetMaskToLen 如 255.255.255.0 对应的网络位长度为 24
func UnixTimeStamp2TimeStr ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.