Documentation
¶
Index ¶
- func Since(c Clock) time.Duration
- func Until(c Clock) time.Duration
- type Clock
- func (c Clock) Add(d time.Duration) Clock
- func (c Clock) After(u Clock) bool
- func (c Clock) Before(u Clock) bool
- func (c Clock) Clock() (hour, min, sec int)
- func (c Clock) Compare(u Clock) int
- func (c Clock) Equal(u Clock) bool
- func (c Clock) Hour() int
- func (c Clock) IsValid() bool
- func (c Clock) MarshalText() ([]byte, error)
- func (c Clock) Minute() int
- func (c Clock) Second() int
- func (c Clock) Seconds() uint64
- func (c Clock) Since(u Clock) time.Duration
- func (c Clock) String() string
- func (c Clock) Sub(u Clock) time.Duration
- func (c Clock) Time() time.Time
- func (c *Clock) UnmarshalText(text []byte) error
- func (c Clock) Until(u Clock) time.Duration
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Clock ¶
type Clock struct {
// contains filtered or unexported fields
}
Clock represents a time within a day (hour, minute, second)
func New ¶
New constructs a Clock from hour, minute, second. Values can exceed normal ranges; they are normalized modulo 24 hours.
func (Clock) Add ¶
Add adds a duration to the Clock and returns a new Clock Duration is truncated to seconds
func (Clock) IsValid ¶ added in v0.1.75
IsValid returns true if the Clock is not the zero/invalid value
func (Clock) MarshalText ¶
MarshalText implements encoding.TextMarshaler
func (*Clock) UnmarshalText ¶
UnmarshalText implements encoding.TextUnmarshaler
Click to show internal directories.
Click to hide internal directories.