Documentation ¶
Index ¶
- Variables
- func CombineDateAndTime(d time.Time, t time.Time) time.Time
- func DurationFromTime(hours int, minutes int, seconds int) time.Duration
- func FloorTime(t time.Time) time.Time
- func FormatNaturalDurationEnglish(iv time.Duration) string
- func FromDays(v int) time.Duration
- func FromHoursFloat64(v float64) time.Duration
- func FromMilliseconds(v int) time.Duration
- func FromMillisecondsFloat(v float64) time.Duration
- func FromMinutes(v int) time.Duration
- func FromMinutesFloat(v float64) time.Duration
- func FromMinutesFloat64(v float64) time.Duration
- func FromSeconds(v int) time.Duration
- func FromSecondsFloat(v float64) time.Duration
- func FromSecondsFloat32(v float32) time.Duration
- func FromSecondsFloat64(v float64) time.Duration
- func FromSecondsInt32(v int32) time.Duration
- func FromSecondsInt64(v int64) time.Duration
- func GetAggregateIsoWeekCount(year int) int
- func GetGlobalWeeknumber(t time.Time) int
- func GetIsoWeekCount(year int) int
- func IsDatePartEqual(a time.Time, b time.Time, tz *time.Location) bool
- func IsSameDayIncludingDateBoundaries(t1 time.Time, t2 time.Time, tz *time.Location) bool
- func IsSunday(t time.Time, tz *time.Location) bool
- func Max(a time.Time, b time.Time) time.Time
- func Min(a time.Time, b time.Time) time.Time
- func TimeToDatePart(t time.Time, tz *time.Location) time.Time
- func TimeToMonthEnd(t time.Time, tz *time.Location) time.Time
- func TimeToMonthStart(t time.Time, tz *time.Location) time.Time
- func TimeToWeekStart(t time.Time, tz *time.Location) time.Time
- func TimeToYearEnd(t time.Time, tz *time.Location) time.Time
- func TimeToYearStart(t time.Time, tz *time.Location) time.Time
- func UnixFloatSeconds(v float64) time.Time
- func WeekdayNameGerman(d time.Weekday) string
- func WithTimePart(base time.Time, hour, minute, second int) time.Time
- type OpenTimeRange
Constants ¶
This section is empty.
Variables ¶
var TimezoneBerlin *time.Location
Functions ¶
func CombineDateAndTime ¶
CombineDateAndTime returns a timestamp with the date-part (`yyyy`, `MM`, `dd`) from the d parameter and the time (`HH`, `mm`, `ss`) from the t parameter
func FormatNaturalDurationEnglish ¶ added in v0.0.5
func FromHoursFloat64 ¶
func FromMilliseconds ¶
func FromMillisecondsFloat ¶
func FromMinutes ¶
func FromMinutesFloat ¶
func FromMinutesFloat64 ¶
func FromSeconds ¶
func FromSecondsFloat ¶
func FromSecondsFloat32 ¶
func FromSecondsFloat64 ¶
func FromSecondsInt32 ¶
func FromSecondsInt64 ¶
func GetGlobalWeeknumber ¶
func GetIsoWeekCount ¶
func IsDatePartEqual ¶
IsDatePartEqual returns true if a and b have the same date part (`yyyy`, `MM` and `dd`)
func IsSameDayIncludingDateBoundaries ¶
IsSameDayIncludingDateBoundaries returns true if t1 and t2 are part of the same day (TZ/Berlin), the boundaries of the day are inclusive, this means 2021-09-15T00:00:00 is still part of the day 2021-09-14
func TimeToDatePart ¶
TimeToDatePart returns a timestamp at the start of the day which contains t (= 00:00:00)
func TimeToMonthEnd ¶
TimeToMonthEnd returns a timestamp at the end of the month which contains t (= yyyy-MM-31 23:59:59.999999999)
func TimeToMonthStart ¶
TimeToMonthStart returns a timestamp at the start of the month which contains t (= yyyy-MM-00 00:00:00)
func TimeToWeekStart ¶
TimeToWeekStart returns a timestamp at the start of the week which contains t (= Monday 00:00:00)
func TimeToYearEnd ¶
TimeToYearEnd returns a timestamp at the end of the month which contains t (= yyyy-12-31 23:59:59.999999999)
func TimeToYearStart ¶
TimeToYearStart returns a timestamp at the start of the year which contains t (= yyyy-01-01 00:00:00)
func UnixFloatSeconds ¶
func WeekdayNameGerman ¶
Types ¶
type OpenTimeRange ¶
func NewOpenTimeRange ¶
func NewOpenTimeRange(from *time.Time, to *time.Time) *OpenTimeRange
func (*OpenTimeRange) AppendToMongoPipeline ¶
func (r *OpenTimeRange) AppendToMongoPipeline(pipeline []interface{}, key string) []interface{}
func (OpenTimeRange) String ¶
func (r OpenTimeRange) String() string
func (OpenTimeRange) ToMongoPipeline ¶
func (r OpenTimeRange) ToMongoPipeline(key string) []interface{}