timeutil: github.com/leekchan/timeutil Index | Files

package timeutil

import "github.com/leekchan/timeutil"

Index

Package Files

strftime.go timedelta.go

func Strftime Uses

func Strftime(t *time.Time, f string) string

Strftime formats time.Date according to the directives in the given format string. The directives begins with a percent (%) character.

type Timedelta Uses

type Timedelta struct {
    Days, Seconds, Microseconds, Milliseconds, Minutes, Hours, Weeks time.Duration
}

Timedelta represents a duration between two dates. All fields are optional and default to 0. You can initialize any type of timedelta by specifying field values which you want to use.

func (*Timedelta) Abs Uses

func (t *Timedelta) Abs() Timedelta

Abs returns the absolute value of t

func (*Timedelta) Add Uses

func (t *Timedelta) Add(t2 *Timedelta) Timedelta

Add returns the Timedelta t+t2.

func (*Timedelta) Duration Uses

func (t *Timedelta) Duration() time.Duration

Duration() returns time.Duration. time.Duration can be added to time.Date.

func (*Timedelta) String Uses

func (t *Timedelta) String() string

String returns a string representing the Timedelta's duration in the form "72h3m0.5s".

func (*Timedelta) Subtract Uses

func (t *Timedelta) Subtract(t2 *Timedelta) Timedelta

Subtract returns the Timedelta t-t2.

Package timeutil imports 3 packages (graph) and is imported by 5 packages. Updated 2016-07-17. Refresh now. Tools for package owners.