timeofday

package
v0.0.0-...-bc6c5c1 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2018 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DateFormat displays how the Clock renders
	DateFormat = "15:04:05"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Clock

type Clock int

Clock represents a date and timezone independent concept of hour, minute, and second

func Parse

func Parse(content string) (Clock, error)

Parse instantiates a Clock from a string representation

func Time

func Time(t time.Time) Clock

Time converts the time into a Clock

func (Clock) EQ

func (c Clock) EQ(t time.Time) bool

EQ returns true if clock == t

func (Clock) GT

func (c Clock) GT(t time.Time) bool

GT returns true if clock > t

func (Clock) GTE

func (c Clock) GTE(t time.Time) bool

GTE returns true if clock >= t

func (Clock) Hour

func (c Clock) Hour() int

Hour returns the clock hour

func (Clock) LT

func (c Clock) LT(t time.Time) bool

LT returns true if clock > t

func (Clock) LTE

func (c Clock) LTE(t time.Time) bool

LTE returns true if clock <= t

func (Clock) Minute

func (c Clock) Minute() int

Minute returns the clock minute

func (*Clock) Scan

func (c *Clock) Scan(src interface{}) error

Scan reads a Clock from the db

func (Clock) Second

func (c Clock) Second() int

Second returns the clock second

func (Clock) String

func (c Clock) String() string

String renders the Clock as a string

func (Clock) Today

func (c Clock) Today() time.Time

Today returns the Clock for the current day

func (Clock) Value

func (c Clock) Value() (driver.Value, error)

Value persistes Clock to a database as a string

Jump to

Keyboard shortcuts

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