Documentation ¶
Index ¶
- Constants
- func Date() string
- func DateAndTime() (string, string)
- func DateTime() string
- func IsLeapYear(year int) bool
- func MonthDays(year, month int) int
- func NowTimeUnix() uint64
- func NowTimeUnixNano() uint64
- func ParseHuman(timestr string) (time.Duration, error)
- func Time() string
- func Timing(f func()) int64
- func ToHuman(nano int64) string
- func UnixNanoSinceNow(sec int) int64
- func YearDays(year int) int
Constants ¶
View Source
const DATETIME_FMT = "2006/01/02 15:04:05"
View Source
const DATE_FMT = "2006/01/02"
View Source
const (
ErrWrongHumanTimeFormat = errors.Err("wrong human time format")
)
View Source
const TIME_FMT = "15:04:05"
Variables ¶
This section is empty.
Functions ¶
func DateAndTime ¶ added in v0.2.2
func DateTime ¶
func DateTime() string
DateTime return curremt datetime in format yyyy/mm/dd HH:MM:SS
func IsLeapYear ¶ added in v0.2.2
IsLeapYear check whether a year is leay
func NowTimeUnixNano ¶
func NowTimeUnixNano() uint64
NowTimeUnixNano is a wrapper of time.Now().UnixNano()
func ParseHuman ¶
ParseHuman convert human time format to duration. support:
'H': hour, 'M': minute, 'S': second, 'm': millsecond, 'u': microsecond, 'n': nanosecond
func ToHuman ¶
ToHuman convert nano to human time size, insufficient portion will be discarded performs rounding.
support 0-999ns, 0-999us, 0-999ms, 0-Maxs,
func UnixNanoSinceNow ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.