Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ParseTimeParam ¶
ParseTimeParam parses time parameters supporting multiple formats: - "now" for current time - Unix timestamps (e.g., "1704067200") - Relative time with flexible formats:
- Short: "1h", "30m", "7d", "5s", "1w"
- Long: "5min", "5mins", "5minute", "5minutes"
- Long: "2hr", "2hrs", "2hour", "2hours"
- Long: "3day", "3days"
- Long: "1week", "1weeks"
- With spaces: "5 minutes", "2 hours"
- With minus prefix: "-5m", "-2h" (treated same as "5m", "2h")
- ISO date strings (e.g., "2024-01-01T00:00:00Z")
func ParseTimeToUnix ¶
ParseTimeToUnix parses time string and returns Unix timestamp in seconds
func ParseTimeToUnixMilli ¶
ParseTimeToUnixMilli parses time string and returns Unix timestamp in milliseconds. Uses Unix()*1000 instead of UnixMilli() to produce second-aligned timestamps. time.Now() and duration arithmetic produce nanosecond precision, and UnixMilli() preserves the sub-second component which some Datadog APIs reject or misinterpret.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.