Documentation ¶
Overview ¶
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 ¶
- Constants
- func SleepUntil(t Arrow)
- type Arrow
- func CParse(layout, value string) (Arrow, error)
- func CParseInLocation(layout, value string, loc *time.Location) (Arrow, error)
- func CParseInStringLocation(layout, value, timezone string) (Arrow, error)
- func Epoch() Arrow
- func InTimezone(timezone string) Arrow
- func New(t time.Time) Arrow
- func NextDay() Arrow
- func NextHour() Arrow
- func NextMinute() Arrow
- func NextSecond() Arrow
- func Now() Arrow
- func Tomorrow() Arrow
- func UTC() Arrow
- func Unix(sec int64, nsec int64) Arrow
- func Yesterday() Arrow
- func (a Arrow) Add(d time.Duration) Arrow
- func (a Arrow) AddDays(days int) Arrow
- func (a Arrow) AddDuration(duration string) Arrow
- func (a Arrow) AddDurations(durations ...string) Arrow
- func (a Arrow) AddHours(hours int) Arrow
- func (a Arrow) AddMinutes(minutes int) Arrow
- func (a Arrow) AddMonths(months int) Arrow
- func (a Arrow) AddSeconds(seconds int) Arrow
- func (a Arrow) AddYears(years int) Arrow
- func (a Arrow) After(b Arrow) bool
- func (a Arrow) AtBeginningOfDay() Arrow
- func (a Arrow) AtBeginningOfHour() Arrow
- func (a Arrow) AtBeginningOfMinute() Arrow
- func (a Arrow) AtBeginningOfMonth() Arrow
- func (a Arrow) AtBeginningOfSecond() Arrow
- func (a Arrow) AtBeginningOfWeek() Arrow
- func (a Arrow) AtBeginningOfYear() Arrow
- func (a Arrow) Before(b Arrow) bool
- func (a Arrow) CFormat(format string) string
- func (a Arrow) Equal(b Arrow) bool
- func (a Arrow) InTimezone(timezone string) Arrow
- func (a Arrow) Sub(b Arrow) time.Duration
- func (a Arrow) Tomorrow() Arrow
- func (a Arrow) UTC() Arrow
- func (a Arrow) UpTo(b Arrow, by time.Duration) []Arrow
- func (a Arrow) Yesterday() Arrow
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
Variables ¶
This section is empty.
Functions ¶
func SleepUntil ¶
func SleepUntil(t Arrow)
Types ¶
type Arrow ¶
func CParse ¶
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 ¶
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 ¶
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 InTimezone ¶
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 NextMinute ¶
func NextMinute() Arrow
func NextSecond ¶
func NextSecond() Arrow
func (Arrow) AddDuration ¶
Add any duration parseable by time.ParseDuration
func (Arrow) AddDurations ¶
Add any durations parseable by time.ParseDuration
func (Arrow) AddMinutes ¶
func (Arrow) AddSeconds ¶
func (Arrow) AtBeginningOfDay ¶
func (Arrow) AtBeginningOfHour ¶
func (Arrow) AtBeginningOfMinute ¶
func (Arrow) AtBeginningOfMonth ¶
func (Arrow) AtBeginningOfSecond ¶
func (Arrow) AtBeginningOfWeek ¶
func (Arrow) AtBeginningOfYear ¶
func (Arrow) CFormat ¶
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) InTimezone ¶
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.