Documentation
¶
Index ¶
- Constants
- func AddHours(timeStart time.Time, deltaHours *big.Rat) time.Time
- func GetLocationOffset(location *time.Location) (timeOffset time.Duration, err error)
- func HoursToDuration(hours *big.Rat) time.Duration
- func IntervalDurationHours(timeStart time.Time, timeEnd time.Time) (delta *big.Rat)
- func IsEmpty(t time.Time) bool
- func Maximum(a time.Time, b time.Time) time.Time
- func Minimum(a time.Time, b time.Time) time.Time
- func NewTimeStringRFC3339(year uint, month uint, day uint, hour uint, minute uint, second uint) string
- func ParseDayTimeStringInLocation(dayTimeString string, location *time.Location) (dayStartTime time.Time, err error)
- func SubHours(timeStart time.Time, deltaHours *big.Rat) time.Time
- func ToDayStart(t time.Time) time.Time
- func ToHourStart(t time.Time) time.Time
- func ToMinuteStart(t time.Time) time.Time
- func ToMonthStart(t time.Time) time.Time
- func ToNextMonthStart(t time.Time) time.Time
- func ToPreviousMonthStart(t time.Time) time.Time
- func ToSecondStart(t time.Time) time.Time
Constants ¶
const FormatDayTimeString = "2006-01-02"
FormatDayTimeString is the format of day time, i.e. a day identifier.
const ( // TimeFormatFor_GetLocationOffset is the time format for the // 'GetLocationOffset' function. TimeFormatFor_GetLocationOffset = "2006-01-02 15:04:05" )
Settings for internal usage.
Variables ¶
This section is empty.
Functions ¶
func GetLocationOffset ¶ added in v0.8.5
GetLocationOffset gets the time offset of a location as duration.
func HoursToDuration ¶ added in v0.8.5
HoursToDuration converts hours into duration. Why ? In Go language it is impossible to simply get a 1/3 of an hour. Moreover, a float32 number storing a 1/3 will always have an error due to its binary nature.
func IntervalDurationHours ¶
IntervalDurationHours calculates the interval duration between two specified time values in hours.
func NewTimeStringRFC3339 ¶
func NewTimeStringRFC3339(year uint, month uint, day uint, hour uint, minute uint, second uint) string
NewTimeStringRFC3339 creates a new time string using the RFC3339.
func ParseDayTimeStringInLocation ¶
func ParseDayTimeStringInLocation(dayTimeString string, location *time.Location) (dayStartTime time.Time, err error)
ParseDayTimeStringInLocation parses time string in the location.
func ToDayStart ¶
ToDayStart returns time rounded to days, i.e. all the sub-day data is rounded to a day's start.
func ToHourStart ¶
ToHourStart returns time rounded to hours, i.e. all the sub-hour data is rounded to an hour's start.
func ToMinuteStart ¶
ToMinuteStart returns time rounded to minutes, i.e. all the sub-minute data is rounded to a minute's start.
func ToMonthStart ¶
ToMonthStart returns time rounded to months, i.e. all the sub-month data is rounded to a month's start.
func ToNextMonthStart ¶
ToNextMonthStart shifts the time to the start of the next month.
func ToPreviousMonthStart ¶
ToPreviousMonthStart shifts the time to the start of the previous month.
Types ¶
This section is empty.