Documentation
¶
Index ¶
- Constants
- func After(d time.Duration) <-chan time.Time
- func Freeze(time time.Time)
- func GetEndOfDayMillis(thisTime time.Time, timeZoneOffset int) int64
- func GetMillis() int64
- func GetMillisForTime(thisTime time.Time) int64
- func GetStartOfDayMillis(thisTime time.Time, timeZoneOffset int) int64
- func IsTimeFrozen() bool
- func NowStr() string
- func PadDateStringZeros(dateString string) string
- func ParseDuration(v string) time.Duration
- func Sleep(d time.Duration)
- func Tick(d time.Duration) <-chan time.Time
- func UnFreeze()
- type Filter
- type Time
- func Create(y int, mon time.Month, d, h, m, s, ns int, location string) (*Time, *errorAVA.Error)
- func CreateFromDate(y int, mon time.Month, d int, location string) (*Time, *errorAVA.Error)
- func CreateFromFormat(layout, value string, location string) (*Time, *errorAVA.Error)
- func CreateFromMonthAndYear(y int, mon time.Month, location string) (*Time, *errorAVA.Error)
- func CreateFromTime(h, m, s, ns int, location string) (*Time, *errorAVA.Error)
- func CreateFromTimestamp(timestamp int64, location string) (*Time, *errorAVA.Error)
- func CreateFromTimestampUTC(timestamp int64) (*Time, *errorAVA.Error)
- func MaxValue() *Time
- func MinValue() *Time
- func NewTime(t time.Time) *Time
- func Now() *Time
- func NowInLocation(loc string) (*Time, *errorAVA.Error)
- func Parse(layout, value, location string) (*Time, *errorAVA.Error)
- func Today(location string) (*Time, *errorAVA.Error)
- func Tomorrow(location string) (*Time, *errorAVA.Error)
- func Yesterday(location string) (*Time, *errorAVA.Error)
- func (c *Time) AddCenturies(cent int) *Time
- func (c *Time) AddCentury() *Time
- func (c *Time) AddDay() *Time
- func (c *Time) AddDays(d int) *Time
- func (c *Time) AddHour() *Time
- func (c *Time) AddHours(h int) *Time
- func (c *Time) AddMinute() *Time
- func (c *Time) AddMinutes(m int) *Time
- func (c *Time) AddMonth() *Time
- func (c *Time) AddMonthNoOverflow() *Time
- func (c *Time) AddMonths(m int) *Time
- func (c *Time) AddMonthsNoOverflow(m int) *Time
- func (c *Time) AddQuarter() *Time
- func (c *Time) AddQuarters(q int) *Time
- func (c *Time) AddSecond() *Time
- func (c *Time) AddSeconds(s int) *Time
- func (c *Time) AddWeek() *Time
- func (c *Time) AddWeekday() *Time
- func (c *Time) AddWeekdays(wd int) *Time
- func (c *Time) AddWeeks(w int) *Time
- func (c *Time) AddYear() *Time
- func (c *Time) AddYears(y int) *Time
- func (c *Time) After(u time.Time) bool
- func (c *Time) Age() int
- func (c *Time) AtomString() string
- func (c *Time) Average(timeAVA *Time) *Time
- func (c *Time) Between(a, b *Time, eq bool) bool
- func (c *Time) Clock() (hour, min, sec int)
- func (c *Time) Closest(a, b *Time) *Time
- func (c *Time) CookieString() string
- func (c *Time) Copy() *Time
- func (c *Time) Date() (year int, month time.Month, day int)
- func (c *Time) DateString() string
- func (c *Time) DateTimeString() string
- func (c *Time) DayDateTimeString() string
- func (c *Time) DaysInMonth() int
- func (c *Time) DaysInYear() int
- func (c *Time) DiffDurationInString(timeAVA *Time) string
- func (c *Time) DiffFiltered(duration time.Duration, f Filter, timeAVA *Time, abs bool) int64
- func (c *Time) DiffInDays(timeAVA *Time, abs bool) int64
- func (c *Time) DiffInDaysFiltered(f Filter, timeAVA *Time, abs bool) int64
- func (c *Time) DiffInHours(d *Time, abs bool) int64
- func (c *Time) DiffInHoursFiltered(f Filter, timeAVA *Time, abs bool) int64
- func (c *Time) DiffInMinutes(d *Time, abs bool) int64
- func (c *Time) DiffInMonths(timeAVA *Time, abs bool) int64
- func (c *Time) DiffInNights(timeAVA *Time, abs bool) int64
- func (c *Time) DiffInSeconds(timeAVA *Time, abs bool) int64
- func (c *Time) DiffInWeekdays(timeAVA *Time, abs bool) int64
- func (c *Time) DiffInWeekendDays(timeAVA *Time, abs bool) int64
- func (c *Time) DiffInWeeks(timeAVA *Time, abs bool) int64
- func (c *Time) DiffInYears(timeAVA *Time, abs bool) int64
- func (c *Time) EndOfCentury() *Time
- func (c *Time) EndOfDay() *Time
- func (c *Time) EndOfDecade() *Time
- func (c *Time) EndOfMonth() *Time
- func (c *Time) EndOfQuarter() *Time
- func (c *Time) EndOfWeek() *Time
- func (c *Time) EndOfYear() *Time
- func (c *Time) Eq(timeAVA *Time) bool
- func (c *Time) EqualTo(timeAVA *Time) bool
- func (c *Time) Farthest(a, b *Time) *Time
- func (c *Time) FirstDayOfMonth() *Time
- func (c *Time) FirstOfMonth(wd time.Weekday) *Time
- func (c *Time) FirstOfQuarter(wd time.Weekday) *Time
- func (c *Time) FirstOfYear(wd time.Weekday) *Time
- func (c *Time) FormattedDateString() string
- func (c *Time) GetTime() time.Time
- func (c *Time) GreaterThan(timeAVA *Time) bool
- func (c *Time) GreaterThanOrEqualTo(timeAVA *Time) bool
- func (c *Time) Gt(timeAVA *Time) bool
- func (c *Time) Gte(timeAVA *Time) bool
- func (c *Time) ISO8601String() string
- func (c *Time) In(loc *time.Location) time.Time
- func (c *Time) IsCurrentMonth() bool
- func (c *Time) IsCurrentYear() bool
- func (c *Time) IsFriday() bool
- func (c *Time) IsFuture() bool
- func (c *Time) IsLastMonth() bool
- func (c *Time) IsLastWeek() bool
- func (c *Time) IsLeapYear() bool
- func (c *Time) IsLongYear() bool
- func (c *Time) IsMonday() bool
- func (c *Time) IsPast() bool
- func (c *Time) IsSameAs(format string, timeAVA *Time) bool
- func (c *Time) IsSameDay(timeAVA *Time) bool
- func (c *Time) IsSameMonth(timeAVA *Time, sameYear bool) bool
- func (c *Time) IsSameYear(timeAVA *Time) bool
- func (c *Time) IsSaturday() bool
- func (c *Time) IsSunday() bool
- func (c *Time) IsThursday() bool
- func (c *Time) IsToday() bool
- func (c *Time) IsTomorrow() bool
- func (c *Time) IsTuesday() bool
- func (c *Time) IsWednesday() bool
- func (c *Time) IsWeekday() bool
- func (c *Time) IsWeekend() bool
- func (c *Time) IsYesterday() bool
- func (c *Time) LastDayOfMonth() *Time
- func (c *Time) LastOfMonth(wd time.Weekday) *Time
- func (c *Time) LastOfQuarter(wd time.Weekday) *Time
- func (c *Time) LastOfYear(wd time.Weekday) *Time
- func (c *Time) LessThan(timeAVA *Time) bool
- func (c *Time) LessThanOrEqualTo(timeAVA *Time) bool
- func (c *Time) Lt(timeAVA *Time) bool
- func (c *Time) Lte(timeAVA *Time) bool
- func (c *Time) Max(timeAVA *Time) *Time
- func (c *Time) Maximum(timeAVA *Time) *Time
- func (c *Time) Min(timeAVA *Time) *Time
- func (c *Time) Minimum(timeAVA *Time) *Time
- func (c *Time) Nanosecond() int
- func (c *Time) Ne(timeAVA *Time) bool
- func (c *Time) Next(wd time.Weekday) *Time
- func (c *Time) NextWeekday() *Time
- func (c *Time) NextWeekendDay() *Time
- func (c *Time) NotEqualTo(timeAVA *Time) bool
- func (c *Time) NthOfMonth(nth int, wd time.Weekday) *Time
- func (c *Time) NthOfQuarter(nth int, wd time.Weekday) *Time
- func (c *Time) NthOfYear(nth int, wd time.Weekday) *Time
- func (c *Time) Previous(wd time.Weekday) *Time
- func (c *Time) PreviousMonthLastDay() *Time
- func (c *Time) PreviousWeekday() *Time
- func (c *Time) PreviousWeekendDay() *Time
- func (c *Time) Quarter() int
- func (c *Time) RFC1036String() string
- func (c *Time) RFC1123String() string
- func (c *Time) RFC2822String() string
- func (c *Time) RFC3339String() string
- func (c *Time) RFC822String() string
- func (c *Time) RFC850String() string
- func (c *Time) RSSString() string
- func (c *Time) ResetStringFormat()
- func (c *Time) SecondsSinceMidnight() int
- func (c *Time) SecondsUntilEndOfDay() int
- func (c *Time) SetDate(y int, m time.Month, d int)
- func (c *Time) SetDateTime(y int, mon time.Month, d, h, m, s int)
- func (c *Time) SetDay(d int)
- func (c *Time) SetHour(h int)
- func (c *Time) SetMinute(m int)
- func (c *Time) SetMonth(m time.Month)
- func (c *Time) SetSecond(s int)
- func (c *Time) SetStringFormat(format string)
- func (c *Time) SetTimeFromTimeString(timeString string) *errorAVA.Error
- func (c *Time) SetTimeZone(name string) *errorAVA.Error
- func (c *Time) SetTimestamp(sec int64)
- func (c *Time) SetWeekEndsAt(wd time.Weekday)
- func (c *Time) SetWeekStartsAt(wd time.Weekday)
- func (c *Time) SetWeekendDays(wds []time.Weekday)
- func (c *Time) SetYear(y int)
- func (c *Time) StartOfCentury() *Time
- func (c *Time) StartOfDay() *Time
- func (c *Time) StartOfDecade() *Time
- func (c *Time) StartOfMonth() *Time
- func (c *Time) StartOfQuarter() *Time
- func (c *Time) StartOfWeek() *Time
- func (c *Time) StartOfYear() *Time
- func (c *Time) String() string
- func (c *Time) SubCenturies(cent int) *Time
- func (c *Time) SubCentury() *Time
- func (c *Time) SubDay() *Time
- func (c *Time) SubDays(d int) *Time
- func (c *Time) SubHour() *Time
- func (c *Time) SubHours(h int) *Time
- func (c *Time) SubMinute() *Time
- func (c *Time) SubMinutes(m int) *Time
- func (c *Time) SubMonth() *Time
- func (c *Time) SubMonthNoOverflow() *Time
- func (c *Time) SubMonths(m int) *Time
- func (c *Time) SubMonthsNoOverflow(m int) *Time
- func (c *Time) SubQuarter() *Time
- func (c *Time) SubQuarters(q int) *Time
- func (c *Time) SubSecond() *Time
- func (c *Time) SubSeconds(s int) *Time
- func (c *Time) SubWeek() *Time
- func (c *Time) SubWeekday() *Time
- func (c *Time) SubWeekdays(wd int) *Time
- func (c *Time) SubWeeks(w int) *Time
- func (c *Time) SubYear() *Time
- func (c *Time) SubYears(y int) *Time
- func (c *Time) TimeString() string
- func (c *Time) TimeZone() string
- func (c *Time) Timestamp() int64
- func (c *Time) W3CString() string
- func (c *Time) WeekEndsAt() time.Weekday
- func (c *Time) WeekOfMonth() int
- func (c *Time) WeekOfYear() (int, int)
- func (c *Time) WeekStartsAt() time.Weekday
- func (c *Time) WeekendDays() []time.Weekday
- type TimeI
Constants ¶
const ( DefaultFormat = "2006-01-02 15:04:05" DateFormat = "2006-01-02" FormattedDateFormat = "Jan 2, 2006" TimeFormat = "15:04:05" HourMinuteFormat = "15:04" HourFormat = "15" DayDateTimeFormat = "Mon, Aug 2, 2006 3:04 PM" CookieFormat = "Monday, 02-Jan-2006 15:04:05 MST" RFC822Format = "Mon, 02 Jan 06 15:04:05 -0700" RFC1036Format = "Mon, 02 Jan 06 15:04:05 -0700" RFC2822Format = "Mon, 02 Jan 2006 15:04:05 -0700" RFC3339Format = "2006-01-02T15:04:05-07:00" RSSFormat = "Mon, 02 Jan 2006 15:04:05 -0700" )
Represents the different string formats for dates
Variables ¶
This section is empty.
Functions ¶
func After ¶
After will be behave like time.After unless time has been frozen If time is frozen it will add the expected delay and immediately send the frozen time on the returned channel
func GetEndOfDayMillis ¶
GetEndOfDayMillis is a convenience method to get milliseconds since epoch for provided date's end of day
func GetMillis ¶
func GetMillis() int64
GetMillis is a convenience method to get milliseconds since epoch.
func GetMillisForTime ¶
GetMillisForTime is a convenience method to get milliseconds since epoch for provided Times.
func GetStartOfDayMillis ¶
GetStartOfDayMillis is a convenience method to get milliseconds since epoch for provided date's start of day
func PadDateStringZeros ¶
PadDateStringZeros is a convenience method to pad 2 digit date parts with zeros to meet ISO 8601 format
func ParseDuration ¶
func Sleep ¶
Sleep will be behave like time.Sleep unless time has been frozen If time is frozen it will add the expected sleep delay and return immediately
Types ¶
type Time ¶
Provides a simple api extension for Times.
func Create ¶
Create returns a new pointer to Times instance from a specific date and time. If the location is invalid, it returns an ErrorAVA instead.
func CreateFromDate ¶
CreateFromDate returns a new pointer to a Times instance from just a date. The time portion is set to now. If the location is invalid, it returns an ErrorAVA instead.
func CreateFromFormat ¶
CreateFromFormat returns a new pointer to a Times instance from a specific format. If the location is invalid, it returns an ErrorAVA instead.
func CreateFromMonthAndYear ¶
CreateFromMonthAndYear returns a new pointer to a Times instance from a specific month and year. If the location is invalid, it returns an ErrorAVA instead.
func CreateFromTime ¶
CreateFromTime returns a new pointer to a Times instance from just a date. The time portion is set to now. If the locations is invalid, it returns an ErrorAVA instead.
func CreateFromTimestamp ¶
CreateFromTimestamp returns a new pointer to a Times instance from a timestamp. If the location is invalid, it returns an ErrorAVA instead.
func CreateFromTimestampUTC ¶
CreateFromTimestampUTC returns a new pointer to a Times instance from an UTC timestamp. If the location is invalid, it returns an ErrorAVA instead.
func MaxValue ¶
func MaxValue() *Time
MaxValue returns a pointer to a new Times instance for greatest supported date
func MinValue ¶
func MinValue() *Time
MinValue returns a pointer to a new Times instance for lowest supported date
func NowInLocation ¶
NowInLocation returns a new Times instance for right now in given location. The location is in IANA Times Zone database, such as "America/New_York".
func Parse ¶
Parser returns a pointer to a new Times instance from a string If the location is invalid, it returns an ErrorAVA instead.
func Today ¶
Today returns a pointer to a new Times instance for today If the location is invalid, it returns an ErrorAVA instead.
func Tomorrow ¶
Tomorrow returns a pointer to a new Times instance for tomorrow If the location is invalid, it returns an ErrorAVA instead.
func Yesterday ¶
Yesterday returns a pointer to a new Times instance for yesterday If the location is invalid, it returns an ErrorAVA instead.
func (*Time) AddCenturies ¶
AddCenturies adds centuries to the time. Positive values travels forward while negative values travels into the past
func (*Time) AddCentury ¶
AddCentury adds a century to the current time
func (*Time) AddDays ¶
AddDays adds a day to the current time. Positive value travels forward while negative value travels into the past
func (*Time) AddHours ¶
AddHours adds an hour to the current time. Positive value travels forward while negative value travels into the past
func (*Time) AddMinutes ¶
AddMinutes adds minutes to the current time. Positive value travels forward while negative value travels into the past.
func (*Time) AddMonthNoOverflow ¶
AddMonthNoOverflow adds a month with no overflow to the current time
func (*Time) AddMonths ¶
AddMonths adds months to the current time. Positive value travels forward while negative values travels into the past
func (*Time) AddMonthsNoOverflow ¶
AddMonthsNoOverflow adds a month to the current time, not overflowing in case the destination month has less days than the current one. Positive value travels forward while negative value travels into the past.
func (*Time) AddQuarter ¶
AddQuarter adds a quarter to the current time
func (*Time) AddQuarters ¶
AddQuarters adds quarters to the current time. Positive values travel forward while negative values travel into the past
func (*Time) AddSeconds ¶
AddSeconds adds seconds to the current time. Positive values travels forward while negative values travels into the past.
func (*Time) AddWeekday ¶
AddWeekday adds a weekday to the current time
func (*Time) AddWeekdays ¶
AddWeekdays adds a weekday to the current time. Positive value travels forward while negative value travels into the past
func (*Time) AddWeeks ¶
AddWeeks adds a week to the current time. Positive value travels forward while negative value travels into the past.
func (*Time) AddYears ¶
AddYears adds a year to the current time. Positive values travel forward while negative values travel into the past
func (*Time) AtomString ¶
AtomString formats the current time to a Atom date format
func (*Time) Between ¶
Between determines if the current instance is between two others eq Indicates if a > and < comparison should be used or <= or >=
func (*Time) CookieString ¶
CookieString formats the current time to a Cookie date format
func (*Time) DateString ¶
DateString return the current time in Y-m-d format
func (*Time) DateTimeString ¶
DateTimeString returns the current time in Y-m-d hh:mm:ss format
func (*Time) DayDateTimeString ¶
DayDateTimeString returns the current time with a day, date and time format
func (*Time) DaysInMonth ¶
DaysInMonth returns the number of days in the month
func (*Time) DaysInYear ¶
DaysInYear returns the number of days in the year
func (*Time) DiffDurationInString ¶
DiffDurationInString returns the duration difference in string format
func (*Time) DiffFiltered ¶
DiffFiltered returns the difference by the given duration using a filter
func (*Time) DiffInDays ¶
DiffInDays returns the difference in days
func (*Time) DiffInDaysFiltered ¶
DiffInDaysFiltered returns the difference in days using a filter
func (*Time) DiffInHours ¶
DiffInHours returns the difference in hours
func (*Time) DiffInHoursFiltered ¶
DiffInHoursFiltered returns the difference in hours using a filter
func (*Time) DiffInMinutes ¶
DiffInMinutes returns the difference in minutes
func (*Time) DiffInMonths ¶
DiffInMonths returns the difference in months
func (*Time) DiffInNights ¶
DiffInNights returns the difference in nights
func (*Time) DiffInSeconds ¶
DiffInSeconds returns the difference in seconds
func (*Time) DiffInWeekdays ¶
DiffInWeekdays returns the difference in weekdays
func (*Time) DiffInWeekendDays ¶
DiffInWeekendDays returns the difference in weekend days using a filter
func (*Time) DiffInWeeks ¶
DiffInWeeks returns the difference in weeks
func (*Time) DiffInYears ¶
DiffInYears returns the difference in years
func (*Time) EndOfCentury ¶
EndOfCentury returns the date of the end of the century at 23:59:59
func (*Time) EndOfDecade ¶
EndOfDecade returns the date at the end of the decade and time at 23:59:59
func (*Time) EndOfMonth ¶
EndOfMonth returns the date at the end of the month and time at 23:59:59
func (*Time) EndOfQuarter ¶
EndOfQuarter returns the date at end of the quarter and time at 23:59:59
func (*Time) FirstDayOfMonth ¶
FirstDayOfMonth returns a new Times instance with the first day of current month
func (*Time) FirstOfMonth ¶
FirstOfMonth returns the first occurrence of a given day of the week in the current month
func (*Time) FirstOfQuarter ¶
FirstOfQuarter returns the first occurrence of a given day of the week in the current quarter
func (*Time) FirstOfYear ¶
FirstOfYear returns the first occurrence of a given day of the week in the current year
func (*Time) FormattedDateString ¶
FormattedDateString returns the current time as a readable date
func (*Time) GreaterThan ¶
GreaterThan determines if the current Times is greater (after) than another
func (*Time) GreaterThanOrEqualTo ¶
GreaterThanOrEqualTo determines if the instance is greater (after) than or equal to another
func (*Time) ISO8601String ¶
ISO8601String returns the current time in ISO8601 format
func (*Time) IsCurrentMonth ¶
IsCurrentMonth determines if the current time is in the current month
func (*Time) IsCurrentYear ¶
IsCurrentYear determines if the current time is in the current year
func (*Time) IsFuture ¶
IsFuture determines if the current time is in the future, ie. greater (after) than now
func (*Time) IsLastMonth ¶
IsLastMonth returns true is the date is within last month
func (*Time) IsLastWeek ¶
IsLastWeek returns true is the date is within last week
func (*Time) IsLeapYear ¶
IsLeapYear determines if current current time is a leap year
func (*Time) IsLongYear ¶
IsLongYear determines if the instance is a long year
func (*Time) IsPast ¶
IsPast determines if the current time is in the past, ie. less (before) than now
func (*Time) IsSameAs ¶
IsSameAs compares the formatted values of the two dates. If passed date is nil, compares against today
func (*Time) IsSameDay ¶
IsSameDay checks if the passed in date is the same day as the current day. If passed date is nil, compares against today
func (*Time) IsSameMonth ¶
IsSameMonth checks if the passed in date is in the same month as the current month If passed date is nil, compares against today
func (*Time) IsSameYear ¶
IsSameYear checks if the passed in date is in the same year as the current time year. If passed date is nil, compares against today
func (*Time) IsSaturday ¶
IsSaturday checks if this day is a Saturday.
func (*Time) IsThursday ¶
IsThursday checks if this day is a Thursday.
func (*Time) IsTomorrow ¶
IsTomorrow determines if the current time is tomorrow
func (*Time) IsWednesday ¶
IsWednesday checks if this day is a Wednesday.
func (*Time) IsYesterday ¶
IsYesterday determines if the current time is yesterday
func (*Time) LastDayOfMonth ¶
LastDayOfMonth returns a new Times instance with the last day of current month
func (*Time) LastOfMonth ¶
LastOfMonth returns the last occurrence of a given day of the week in the current month
func (*Time) LastOfQuarter ¶
LastOfQuarter returns the last occurrence of a given day of the week in the current quarter
func (*Time) LastOfYear ¶
LastOfYear returns the last occurrence of a given day of the week in the current year
func (*Time) LessThanOrEqualTo ¶
LessThanOrEqualTo determines if the instance is less (before) or equal to another
func (*Time) Max ¶
Max returns the maximum instance between a given instance and the current instance
func (*Time) Maximum ¶
Maximum returns the maximum instance between a given instance and the current instance
func (*Time) Min ¶
Min returns the minimum instance between a given instance and the current instance
func (*Time) Minimum ¶
Minimum returns the minimum instance between a given instance and the current instance
func (*Time) Nanosecond ¶
func (*Time) NextWeekday ¶
NextWeekday goes forward to the next weekday
func (*Time) NextWeekendDay ¶
NextWeekendDay goes forward to the next weekend day
func (*Time) NotEqualTo ¶
NotEqualTo determines if the current Times is not equal to another
func (*Time) NthOfMonth ¶
NthOfMonth returns the given occurrence of a given day of the week in the current month If the calculated occurrence is outside the scope of current month, no modifications are made
func (*Time) NthOfQuarter ¶
NthOfQuarter returns the given occurrence of a given day of the week in the current quarter If the calculated occurrence is outside the scope of current quarter, no modifications are made
func (*Time) NthOfYear ¶
NthOfYear returns the given occurrence of a given day of the week in the current year If the calculated occurrence is outside the scope of current year, no modifications are made
func (*Time) Previous ¶
Previous changes the time to the previous occurrence of a given day of the week
func (*Time) PreviousMonthLastDay ¶
PreviousMonthLastDay returns the last day of the previous month
func (*Time) PreviousWeekday ¶
PreviousWeekday goes back to the previous weekday
func (*Time) PreviousWeekendDay ¶
PreviousWeekendDay goes back to the previous weekend day
func (*Time) RFC1036String ¶
RFC1036String returns the current time in RFC 1036 format
func (*Time) RFC1123String ¶
RFC1123String returns the current time in RFC 1123 format
func (*Time) RFC2822String ¶
RFC2822String returns the current time in RFC 2822 format
func (*Time) RFC3339String ¶
RFC3339String returns the current time in RFC 3339 format
func (*Time) RFC822String ¶
RFC822String returns the current time in RFC 822 format
func (*Time) RFC850String ¶
RFC850String returns the current time in RFC 850 format
func (*Time) ResetStringFormat ¶
func (c *Time) ResetStringFormat()
ResetStringFormat changes the format to the DefaultFormat
func (*Time) SecondsSinceMidnight ¶
SecondsSinceMidnight returns the number of seconds since midnight.
func (*Time) SecondsUntilEndOfDay ¶
SecondsUntilEndOfDay returns the number of seconds until 23:59:59.
func (*Time) SetDateTime ¶
SetDateTime sets the date and the time
func (*Time) SetStringFormat ¶
SetStringFormat formats the current time with the set format string
func (*Time) SetTimeFromTimeString ¶
SetTimeFromTimeString receives a string and sets the current time It accepts the following formats: "hh:mm:ss", "hh:mm" and "hh"
func (*Time) SetTimeZone ¶
SetTimeZone sets the location from a string If the location is invalid, it returns an ErrorAVA instead.
func (*Time) SetTimestamp ¶
SetTimestamp sets the current time given a timestamp
func (*Time) SetWeekEndsAt ¶
SetWeekEndsAt sets the last day of week
func (*Time) SetWeekStartsAt ¶
SetWeekStartsAt sets the first day of week
func (*Time) SetWeekendDays ¶
SetWeekendDays sets the weekend days
func (*Time) StartOfCentury ¶
StartOfCentury returns the date of the first day of the century at 00:00:00
func (*Time) StartOfDay ¶
StartOfDay returns the time at 00:00:00 of the same day
func (*Time) StartOfDecade ¶
StartOfDecade returns the date at the first day of the decade and time at 00:00:00
func (*Time) StartOfMonth ¶
StartOfMonth returns the date on the first day of the month and the time to 00:00:00
func (*Time) StartOfQuarter ¶
StartOfQuarter returns the date at the first day of the quarter and time at 00:00:00
func (*Time) StartOfWeek ¶
StartOfWeek returns the date of the first day of week at 00:00:00
func (*Time) StartOfYear ¶
StartOfYear returns the date at the first day of the year and the time at 00:00:00
func (*Time) SubCenturies ¶
SubCenturies removes centuries from the current time
func (*Time) SubCentury ¶
SubCentury removes a century from the current time
func (*Time) SubMinutes ¶
SubMinutes removes minutes from the current time
func (*Time) SubMonthNoOverflow ¶
SubMonthNoOverflow remove a month with no overflow from the current time
func (*Time) SubMonthsNoOverflow ¶
SubMonthsNoOverflow removes months with no overflow from the current time
func (*Time) SubQuarter ¶
SubQuarter removes a quarter from the current time
func (*Time) SubQuarters ¶
SubQuarters removes quarters from current time
func (*Time) SubSeconds ¶
SubSeconds removes seconds from the current time
func (*Time) SubWeekday ¶
SubWeekday removes a weekday from the current time
func (*Time) SubWeekdays ¶
SubWeekdays removes a weekday from the current time
func (*Time) TimeString ¶
TimeString returns the current time in hh:mm:ss format
func (*Time) WeekEndsAt ¶
WeekEndsAt gets the ending day of the week
func (*Time) WeekOfMonth ¶
WeekOfMonth returns the week of the month
func (*Time) WeekOfYear ¶
WeekOfYear returns the week of the current year. This is an alias for time.ISOWeek
func (*Time) WeekStartsAt ¶
WeekStartsAt get the starting day of the week
func (*Time) WeekendDays ¶
WeekendDays gets the weekend days of the week
type TimeI ¶
type TimeI interface {
Copy() *Time
WeekStartsAt() time.Weekday
WeekEndsAt() time.Weekday
WeekendDays() []time.Weekday
Quarter() int
Age() int
DaysInMonth() int
DaysInYear() int
WeekOfMonth() int
WeekOfYear() (int, int)
TimeZone() string
Timestamp() int64
String() string
AddYears(y int) *Time
AddYear() *Time
AddQuarters(q int) *Time
AddQuarter() *Time
AddCenturies(cent int) *Time
AddCentury() *Time
AddMonths(m int) *Time
AddMonth() *Time
AddSeconds(s int) *Time
AddSecond() *Time
AddDays(d int) *Time
AddDay() *Time
AddWeekdays(wd int) *Time
AddWeekday() *Time
AddWeeks(w int) *Time
AddWeek() *Time
AddHours(h int) *Time
AddHour() *Time
AddMonthsNoOverflow(m int) *Time
PreviousMonthLastDay() *Time
AddMonthNoOverflow() *Time
AddMinutes(m int) *Time
AddMinute() *Time
SubYear() *Time
SubYears(y int) *Time
SubQuarter() *Time
SubQuarters(q int) *Time
SubCentury() *Time
SubCenturies(cent int) *Time
SubMonth() *Time
SubMonths(m int) *Time
SubMonthNoOverflow() *Time
SubMonthsNoOverflow(m int) *Time
SubDay() *Time
SubDays(d int) *Time
SubWeekday() *Time
SubWeekdays(wd int) *Time
SubWeek() *Time
SubWeeks(w int) *Time
SubHour() *Time
SubHours(h int) *Time
SubMinute() *Time
SubMinutes(m int) *Time
SubSecond() *Time
SubSeconds(s int) *Time
SetYear(y int)
SetMonth(m time.Month)
SetDay(d int)
SetHour(h int)
SetMinute(m int)
SetSecond(s int)
SetDate(y int, m time.Month, d int)
SetDateTime(y int, mon time.Month, d, h, m, s int)
SetTimeFromTimeString(timeString string) *errorAVA.Error
SetWeekEndsAt(wd time.Weekday)
SetWeekStartsAt(wd time.Weekday)
SetWeekendDays(wds []time.Weekday)
SetTimestamp(sec int64)
SetTimeZone(name string) *errorAVA.Error
ResetStringFormat()
SetStringFormat(format string)
DateString() string
FormattedDateString() string
TimeString() string
DateTimeString() string
DayDateTimeString() string
AtomString() string
CookieString() string
ISO8601String() string
RFC822String() string
RFC850String() string
RFC1036String() string
RFC1123String() string
RFC2822String() string
RFC3339String() string
RSSString() string
W3CString() string
IsWeekday() bool
IsWeekend() bool
IsYesterday() bool
IsToday() bool
IsTomorrow() bool
IsFuture() bool
IsPast() bool
IsLeapYear() bool
IsLongYear() bool
IsSameAs(format string, time *Time) bool
IsCurrentYear() bool
IsSameYear(time *Time) bool
IsCurrentMonth() bool
IsSameMonth(time *Time, sameYear bool) bool
IsSameDay(time *Time) bool
IsSunday() bool
IsMonday() bool
IsTuesday() bool
IsWednesday() bool
IsThursday() bool
IsFriday() bool
IsSaturday() bool
IsLastWeek() bool
IsLastMonth() bool
Eq(time *Time) bool
EqualTo(time *Time) bool
Ne(time *Time) bool
NotEqualTo(time *Time) bool
Gt(time *Time) bool
GreaterThan(time *Time) bool
Gte(time *Time) bool
GreaterThanOrEqualTo(time *Time) bool
Lt(time *Time) bool
LessThan(time *Time) bool
Lte(time *Time) bool
LessThanOrEqualTo(time *Time) bool
Between(a, b *Time, eq bool) bool
Closest(a, b *Time) *Time
Farthest(a, b *Time) *Time
Min(time *Time) *Time
Minimum(time *Time) *Time
Max(time *Time) *Time
Maximum(time *Time) *Time
DiffInYears(time *Time, abs bool) int64
DiffInMonths(time *Time, abs bool) int64
DiffDurationInString(time *Time) string
DiffInWeeks(time *Time, abs bool) int64
DiffInDays(time *Time, abs bool) int64
DiffInNights(time *Time, abs bool) int64
DiffInDaysFiltered(f Filter, time *Time, abs bool) int64
DiffInHoursFiltered(f Filter, time *Time, abs bool) int64
DiffInWeekdays(time *Time, abs bool) int64
DiffInWeekendDays(time *Time, abs bool) int64
DiffFiltered(duration time.Duration, f Filter, time *Time, abs bool) int64
DiffInHours(d *Time, abs bool) int64
DiffInMinutes(d *Time, abs bool) int64
DiffInSeconds(time *Time, abs bool) int64
SecondsSinceMidnight() int
SecondsUntilEndOfDay() int
StartOfDay() *Time
EndOfDay() *Time
StartOfMonth() *Time
EndOfMonth() *Time
StartOfQuarter() *Time
EndOfQuarter() *Time
StartOfYear() *Time
EndOfYear() *Time
StartOfDecade() *Time
EndOfDecade() *Time
StartOfCentury() *Time
EndOfCentury() *Time
StartOfWeek() *Time
EndOfWeek() *Time
Next(wd time.Weekday) *Time
NextWeekday() *Time
PreviousWeekday() *Time
NextWeekendDay() *Time
PreviousWeekendDay() *Time
Previous(wd time.Weekday) *Time
FirstOfMonth(wd time.Weekday) *Time
LastOfMonth(wd time.Weekday) *Time
LastDayOfMonth() *Time
FirstDayOfMonth() *Time
NthOfMonth(nth int, wd time.Weekday) *Time
FirstOfQuarter(wd time.Weekday) *Time
LastOfQuarter(wd time.Weekday) *Time
NthOfQuarter(nth int, wd time.Weekday) *Time
FirstOfYear(wd time.Weekday) *Time
LastOfYear(wd time.Weekday) *Time
NthOfYear(nth int, wd time.Weekday) *Time
Average(time *Time) *Time
Clock() (hour, min, sec int)
Nanosecond() int
Date() (year int, month time.Month, day int)
In(loc *time.Location) time.Time
Day() int
Month() time.Month
Year() int
After(u time.Time) bool
GetTime() time.Time
Format(layout string) string
Sub(u time.Time) time.Duration
UnixNano() int64
Location() *time.Location
Add(d time.Duration) time.Time
Weekday() time.Weekday
// contains filtered or unexported methods
}