datetime

package
v0.1.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 10, 2026 License: Apache-2.0 Imports: 7 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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.

func (*ToolProvider) GetTools

func (p *ToolProvider) GetTools() []tool.Tool

GetTools returns the datetime tool.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL