timetogo

package
v0.0.0-...-d4e9f3a Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2016 License: GPL-3.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Days

func Days(v interface{}) (d time.Duration)

Days Converts an value value in minutes

func Hours

func Hours(v interface{}) (d time.Duration)

Hours Converts an value value in minutes

func Minutes

func Minutes(v interface{}) (d time.Duration)

Minutes Converts an value value in minutes

func Seconds

func Seconds(v interface{}) (d time.Duration)

Seconds Converts an value value in minutes

Types

type Day

type Day int

Day A day, given by its position in the month, between 1-31

type Dayer

type Dayer interface {
	Day() Day
}

Dayer Generate a day, between 0-31

type Durationer

type Durationer interface {
	Duration() time.Duration
}

Durationer An object that can be converted to a duration

type Hour

type Hour int

Hour An hour, given by its position in the day, between 0-23

type Hourer

type Hourer interface {
	Hour() Hour
}

Hourer Generate an hour, between 0-23

type Minute

type Minute int

Minute A minute, between 0-59

type Minuter

type Minuter interface {
	Minuter() Minute
}

Minuter Generate minutes, between 0-59

type Month

type Month int

Month A month

type Monthday

type Monthday struct {
	Day   Day
	Month time.Month
}

Monthday A day in a month, do not check if it exists (30 february)

func NewMonthday

func NewMonthday(d Day, m time.Month) (md *Monthday)

NewMonthday Generate a new Monthday

type Second

type Second int

Second A second, the tiniest unit of timetogo

type Seconder

type Seconder interface {
	Seconder() Second
}

Seconder Generate seconds, berween 0-59

type Time

type Time struct {
	Year   Year
	Month  Month
	Day    Day
	Hour   Hour
	Minute Minute
	Second Second
}

Time A strut representation of an instant, previse to the second

func NewZeroTime

func NewZeroTime() (t *Time)

NewZeroTime Generate a new time, initialized to year 0, month 1, day 1, hour 0, minute 0, second 0

func (Time) Before

func (t Time) Before(tt time.Time) bool

Before Check whether a time is before another

func (Time) ToTime

func (t Time) ToTime() (tt time.Time)

ToTime Convert a timetogo.Time (a struct) in a time.Time object

type Weekdayer

type Weekdayer interface {
	Weekday() time.Weekday
}

Weekdayer Generate a week day, between Monday-Sunday

type Year

type Year int

Year A year

Jump to

Keyboard shortcuts

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