Documentation
¶
Overview ¶
Package timeutil provides standardized UTC time helpers.
Index ¶
- func CalculateNextWindow(t time.Time, loc *time.Location) time.Time
- func FormatISO(t time.Time) string
- func FormatUTCISO(t time.Time) string
- func IsCommitWindowAllowed(t time.Time, loc *time.Location) bool
- func IsMorningAllowed(t time.Time, cutoffHour int) bool
- func IsWeekday(t time.Time) bool
- func IsWeekend(t time.Time) bool
- func NowUTC() time.Time
- func NowUTCISO() string
- func ParseISO(s string) (time.Time, error)
- func ResolveLocation(raw string) (*time.Location, error)
- func SimulateMorningWindow(t time.Time, loc *time.Location) time.Time
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CalculateNextWindow ¶
CalculateNextWindow calculates the next valid slot (07:30 AM next weekday morning, or weekend).
func FormatUTCISO ¶
FormatUTCISO formats a timestamp to RFC3339 in UTC.
func IsCommitWindowAllowed ¶
IsCommitWindowAllowed returns true if weekend, or if weekday and hour < 8.
func IsMorningAllowed ¶
IsMorningAllowed reports whether the time's hour is before cutoffHour.
func NowUTCISO ¶
func NowUTCISO() string
NowUTCISO returns the current UTC timestamp formatted as RFC3339.
func ResolveLocation ¶
ResolveLocation resolves IANA names, "UTC", "Local", and numeric offsets (+08:00, -0400).
Types ¶
This section is empty.