Categorygithub.com/weathersource/go-timeext
modulepackage
1.0.6
Repository: https://github.com/weathersource/go-timeext.git
Documentation: pkg.go.dev

# README

go-timeext

CircleCI GoDoc

Package timeext provides functions that supplement the golang time library.

# Functions

Date validates t is formatted YYYY-MM-DD and returns time object.
DayCount returns the count of days inclusively bounded by dateStart and dateEnd.
Returns a timestamp representing a day period in a given timezone, accounting for when DST occurs at midnight (see https://github.com/golang/go/issues/35508).
HourCount returns the count of days inclusively bounded by dateStart and dateEnd.
QuarterHourCount returns the count of days inclusively bounded by dateStart and dateEnd.
Timestamp validates t is formatted RFC 3339 and returns time object.
TimestampRounded validates t is formatted RFC 3339 and returns a time object rounded to the top of the UTC hour.
TimestampRoundedQuarterHour validates t is formatted RFC 3339 and returns a time object rounded down to the nearest UTC quarter hour.
TimestampRoundedQuarterHourString validates t is formatted RFC 3339 and returns a string formatted RFC 3339 rounded down to the nearest UTC quarter hour.
TimestampRoundedString validates t is formatted RFC 3339 and returns a string formatted RFC 3339 rounded to the top of the UTC hour.
ToDate converts a time object to a date string.
ToTimestamp converts a time object to a RFC 9993 timestamp string.