Documentation
¶
Overview ¶
Package datetime provides time and date tools for agents. LLMs are notoriously poor at temporal reasoning — this package gives them precise control over current time queries, timezone conversions, date arithmetic, duration calculations, and format parsing.
Problem: LLMs have no concept of "now" and cannot reliably compute time differences, timezone conversions, or date arithmetic. This package provides a deterministic time engine that handles these operations correctly.
Supported operations:
- now — current time in any timezone
- convert — timezone conversion between IANA zones
- add / subtract — date arithmetic (add 3 days, subtract 2 hours, etc.)
- diff — duration between two dates
- parse — auto-detect and parse 100+ date formats
- format — format dates into any Go time layout
Dependencies:
- github.com/araddon/dateparse — auto-detects 100+ date formats (2.1k+ ⭐)
- Go stdlib time — IANA timezone database
- No external system dependencies
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ToolProvider ¶
type ToolProvider struct{}
ToolProvider wraps the datetime tool and satisfies the tools.ToolProviders interface.
func NewToolProvider ¶
func NewToolProvider() *ToolProvider
NewToolProvider creates a ToolProvider for the datetime tool.