ztime

package
v0.7.9 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2022 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Day   time.Duration = time.Hour * 24
	Week                = Day * 7
	Month               = Day * 31
	Year                = Day * 365
)

Variables

This section is empty.

Functions

func IsWeekday

func IsWeekday(date time.Time) bool

Returns true if the given date falls on a weekday

func IsWeekend

func IsWeekend(date time.Time) bool

Returns true if the given date falls on a weekend

func ParseDuration added in v0.7.9

func ParseDuration(s string) (time.Duration, error)

Extend version of ParseDuration. Source code is almost identical to Supports day (d) and week (w) units as well as general month (M) and year (Y) durations. Month is defined as 31 days and a year is 365 days.

Types

type ParseError added in v0.7.9

type ParseError struct {
	Layout     string
	Value      string
	LayoutElem string
	ValueElem  string
	Message    string
}

ParseError describes a problem parsing a time string.

Jump to

Keyboard shortcuts

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