arrow: github.com/bmuller/arrow/lib Index | Files

package arrow

import "github.com/bmuller/arrow/lib"

Package arrow provides C-style date formating and parsing, along with other date goodies.

See the github project page at http://github.com/bmuller/arrow for more info.

Index

Package Files

arrow.go

Constants

const (
    Nanosecond  time.Duration = 1
    Microsecond               = 1000 * Nanosecond
    Millisecond               = 1000 * Microsecond
    Second                    = 1000 * Millisecond
    Minute                    = 60 * Second
    Hour                      = 60 * Minute
    Day                       = 24 * Hour
    Week                      = 7 * Day
)

Like time's constants, but with Day and Week

func SleepUntil Uses

func SleepUntil(t Arrow)

type Arrow Uses

type Arrow struct {
    time.Time
}

func CParse Uses

func CParse(layout, value string) (Arrow, error)

Parse the time using the same format string types as strftime See http://man7.org/linux/man-pages/man3/strftime.3.html for more info.

func CParseInLocation Uses

func CParseInLocation(layout, value string, loc *time.Location) (Arrow, error)

Parse the time using the same format string types as strftime, within the given location. See http://man7.org/linux/man-pages/man3/strftime.3.html for more info.

func CParseInStringLocation Uses

func CParseInStringLocation(layout, value, timezone string) (Arrow, error)

Parse the time using the same format string types as strftime, within the given location (string value for timezone). See http://man7.org/linux/man-pages/man3/strftime.3.html for more info.

func Epoch Uses

func Epoch() Arrow

func InTimezone Uses

func InTimezone(timezone string) Arrow

Get the current time in the given timezone. The timezone parameter should correspond to a file in the IANA Time Zone database, such as "America/New_York". "UTC" and "Local" are also acceptable. If the timezone given isn't valid, then no change to the timezone is made.

func New Uses

func New(t time.Time) Arrow

func NextDay Uses

func NextDay() Arrow

func NextHour Uses

func NextHour() Arrow

func NextMinute Uses

func NextMinute() Arrow

func NextSecond Uses

func NextSecond() Arrow

func Now Uses

func Now() Arrow

func Tomorrow Uses

func Tomorrow() Arrow

func UTC Uses

func UTC() Arrow

func Unix Uses

func Unix(sec int64, nsec int64) Arrow

func Yesterday Uses

func Yesterday() Arrow

func (Arrow) Add Uses

func (a Arrow) Add(d time.Duration) Arrow

func (Arrow) AddDays Uses

func (a Arrow) AddDays(days int) Arrow

func (Arrow) AddDuration Uses

func (a Arrow) AddDuration(duration string) Arrow

Add any duration parseable by time.ParseDuration

func (Arrow) AddDurations Uses

func (a Arrow) AddDurations(durations ...string) Arrow

Add any durations parseable by time.ParseDuration

func (Arrow) AddHours Uses

func (a Arrow) AddHours(hours int) Arrow

func (Arrow) AddMinutes Uses

func (a Arrow) AddMinutes(minutes int) Arrow

func (Arrow) AddSeconds Uses

func (a Arrow) AddSeconds(seconds int) Arrow

func (Arrow) After Uses

func (a Arrow) After(b Arrow) bool

func (Arrow) AtBeginningOfDay Uses

func (a Arrow) AtBeginningOfDay() Arrow

func (Arrow) AtBeginningOfHour Uses

func (a Arrow) AtBeginningOfHour() Arrow

func (Arrow) AtBeginningOfMinute Uses

func (a Arrow) AtBeginningOfMinute() Arrow

func (Arrow) AtBeginningOfMonth Uses

func (a Arrow) AtBeginningOfMonth() Arrow

func (Arrow) AtBeginningOfSecond Uses

func (a Arrow) AtBeginningOfSecond() Arrow

func (Arrow) AtBeginningOfWeek Uses

func (a Arrow) AtBeginningOfWeek() Arrow

func (Arrow) AtBeginningOfYear Uses

func (a Arrow) AtBeginningOfYear() Arrow

func (Arrow) Before Uses

func (a Arrow) Before(b Arrow) bool

func (Arrow) CFormat Uses

func (a Arrow) CFormat(format string) string

Format the time using the same format string types as strftime. See http://man7.org/linux/man-pages/man3/strftime.3.html for more info.

func (Arrow) Equal Uses

func (a Arrow) Equal(b Arrow) bool

func (Arrow) InTimezone Uses

func (a Arrow) InTimezone(timezone string) Arrow

The timezone parameter should correspond to a file in the IANA Time Zone database, such as "America/New_York". "UTC" and "Local" are also acceptable. If the timezone given isn't valid, then no change to the timezone is made.

func (Arrow) Sub Uses

func (a Arrow) Sub(b Arrow) time.Duration

func (Arrow) Tomorrow Uses

func (a Arrow) Tomorrow() Arrow

func (Arrow) UTC Uses

func (a Arrow) UTC() Arrow

func (Arrow) UpTo Uses

func (a Arrow) UpTo(b Arrow, by time.Duration) []Arrow

Return an array of Arrow's from this one up to the given one, by duration. For instance, Now().UpTo(Tomorrow(), Hour) will return an array of Arrow's from now until tomorrow by hour (inclusive of a and b).

func (Arrow) Yesterday Uses

func (a Arrow) Yesterday() Arrow

Package arrow imports 3 packages (graph) and is imported by 1 packages. Updated 2016-07-20. Refresh now. Tools for package owners.