explaingit

tj/go-naturaldate

Analysis updated 2026-07-03 · repo last pushed 2024-05-17

315GoAudience · developerComplexity · 2/5DormantLicenseSetup · easy

TLDR

A Go package that converts plain-English phrases like "yesterday at 10am" or "three days ago" into actual dates and times, so users don't need to type rigid timestamp formats.

Mindmap

mindmap
  root((repo))
    What it does
      Parses natural language dates
      Handles relative time
      Ignores extra words
    Use cases
      Log search tools
      Chat bots and reminders
      Dashboard time filters
    Behavior
      Defaults to past dates
      Configurable direction
      Supports written numbers
    Tech stack
      Go
      Library package
    Audience
      CLI tool builders
      Backend developers
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Add forgiving date parsing to a CLI log search tool so engineers can type "yesterday at 10am" instead of exact timestamps.

USE CASE 2

Build a chat bot that schedules reminders from natural phrases like "remind me in 5 days" or "next Sunday at 5pm."

USE CASE 3

Create a reporting dashboard time-range filter that accepts inputs like "last month" or "two weeks ago."

What is it built with?

Go

How does it compare?

tj/go-naturaldatecaddyserver/nginx-adaptertj/triage
Stars315354409
LanguageGoGoGo
Last pushed2024-05-172026-02-152020-05-29
MaintenanceDormantMaintainedDormant
Setup difficultyeasyeasymoderate
Complexity2/52/52/5
Audiencedeveloperops devopsdeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · easy Time to first run · 5min
Use freely for any purpose, including commercial use, as long as you keep the copyright notice.

In plain English

go-naturaldate is a package for the Go programming language that takes plain-English phrases like "yesterday at 10am" or "three days ago" and converts them into actual dates and times that a computer can understand. It was built for a command-line log search tool, where people need to type quick time ranges without fumbling with exact date formats. Instead of forcing users to enter something rigid like "2024-01-15T10:00:00Z," it lets them write the way they naturally speak. You can say "last Sunday at 5:30pm," "next January," "December 25th at 7:30am," or even "remind me on the 25th of December at 7:30am." The library ignores extra words around the date expression, so a sentence like "Restart the server in 5 days from now" still works, it picks out the relevant time reference and figures out the rest. Written-out numbers like "two weeks" are handled just as well as numeric ones. The main use case is any application where people type into a search box or command line and you want the experience to feel forgiving and natural. A log search tool is the original motivation: an engineer investigating an issue wants to pull up logs from "yesterday at 10am" without stopping to calculate timestamps. The same idea could apply to a chat bot that schedules reminders, a reporting dashboard with a time-range filter, or any text interface where users express relative time concepts like "5 minutes ago" or "last month." One small but thoughtful detail: when someone types an ambiguous word like "Sunday" or "September," the library defaults to the past, meaning the most recent one. A developer can flip this default direction if their app expects future-looking input instead.

Copy-paste prompts

Prompt 1
Using the go-naturaldate package in Go, write a function that takes a string like "yesterday at 10am" and returns a time.Time value.
Prompt 2
Help me add go-naturaldate to my Go CLI tool so users can type natural language date ranges like "three days ago" to filter results.
Prompt 3
Show me how to configure go-naturaldate to default to future dates instead of past dates when parsing ambiguous phrases like "Sunday."

Frequently asked questions

What is go-naturaldate?

A Go package that converts plain-English phrases like "yesterday at 10am" or "three days ago" into actual dates and times, so users don't need to type rigid timestamp formats.

What language is go-naturaldate written in?

Mainly Go. The stack also includes Go.

Is go-naturaldate actively maintained?

Dormant — no commits in 2+ years (last push 2024-05-17).

What license does go-naturaldate use?

Use freely for any purpose, including commercial use, as long as you keep the copyright notice.

How hard is go-naturaldate to set up?

Setup difficulty is rated easy, with roughly 5min to a first successful run.

Who is go-naturaldate for?

Mainly developer.

Open on GitHub → Explain another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.