Documentation
¶
Index ¶
- func EndOfDay(t time.Time) time.Time
- func IsToday(t time.Time) bool
- func IsTodayLoc(t time.Time, loc *time.Location) bool
- func IsTomorrow(t time.Time) bool
- func IsTomorrowLoc(t time.Time, loc *time.Location) bool
- func ParseDuration(s string) (time.Duration, error)
- func StartOfDay(t time.Time) time.Time
- func TimeAgo(t time.Time) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsToday ¶
IsToday checks if a timestamp is today in the current local timezone Compares after StartOfDay and before StartOfDay + 24h Exact StartOfDay today is considered today Exact EndOfDay today is considered today
func IsTodayLoc ¶
IsTodayLoc checks if a timestamp is today in the specified time.Location Compares after StartOfDay and before StartOfDay + 24h Exact StartOfDay today is considered today Exact EndOfDay today is considered today
func IsTomorrow ¶
IsTomorrow checks if a timestamp is tomorrow in the current local timezone Compares after StartOfDay + 24h and before StartOfDay + 48h Exact StartOfDay tomorrow is considered tomorrow Exact EndOfDay tomorrow is considered tomorrow
func IsTomorrowLoc ¶
IsTomorrowLoc checks if a timestamp is tomorrow in the specified time.Location Compares after StartOfDay + 24h and before StartOfDay + 48h Exact StartOfDay tomorrow is considered tomorrow Exact EndOfDay tomorrow is considered tomorrow
func ParseDuration ¶
ParseDuration extends time.ParseDuration to support "d" (days) and "w" (weeks) Replaces d with 24h, w with 168h, then pass to time.ParseDuration Supports float values too
func StartOfDay ¶
StartOfDay returns the date at 00:00:00.000 in the same location
Types ¶
This section is empty.