Documentation
¶
Overview ¶
Package nltime parses natural-language time expressions into time.Time or time.Duration values.
Supported Expressions ¶
- Relative: "3 days ago", "in 2 hours", "5 minutes from now"
- Absolute: "yesterday", "today", "tomorrow", "now"
- Short: "3d ago", "2h from now", "5m ago", "10s later"
- Named: "next monday", "last friday", "this weekend"
- Time of day: "3pm", "10:30", "noon", "midnight"
- Combined: "tomorrow at 3pm", "next monday 10:00"
Quick start ¶
t, err := nltime.Parse("3 days ago", time.Now())
t, err := nltime.Parse("tomorrow at 3pm", time.Now())
d, err := nltime.ParseDuration("2 hours 30 minutes")
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MustParseDuration ¶
MustParseDuration is like ParseDuration but panics on error.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.