whatisgithub

What is chronic?

mojombo/chronic — explained in plain English

Analysis updated 2026-07-23 · repo last pushed 2023-09-28

3,256RubyAudience · developerComplexity · 2/5DormantSetup · easy

In one sentence

Chronic is a Ruby library that turns plain-English date and time phrases like 'next Friday at 5pm' into structured dates your app can use, so users never have to fill out a rigid calendar form.

Mindmap

mindmap
  root((repo))
    What it does
      Parses natural dates
      Returns nil on failure
    Tech stack
      Ruby
      Time class
      ActiveSupport optional
    Use cases
      Task reminders
      Scheduling tools
      Flexible date input
    Audience
      Ruby developers
      App builders
    Key features
      Case insensitive
      Handles abbreviations
      Time zone support
    Limitations
      Date range limits

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

Let users type natural reminders like 'next Tuesday at 3pm' in a task manager app.

USE CASE 2

Build a scheduling tool that accepts phrases like 'last Friday at 20:00' instead of strict date formats.

USE CASE 3

Add flexible date parsing to any Ruby app so users can say 'tomorrow' or '3 years ago'.

What is it built with?

Ruby

How does it compare?

mojombo/chronicscenic-views/scenicfatfreecrm/fat_free_crm
Stars3,2563,6213,626
LanguageRubyRubyRuby
Last pushed2023-09-28
MaintenanceDormant
Setup difficultyeasymoderatemoderate
Complexity2/52/53/5
Audiencedeveloperdeveloperdeveloper

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

How do you get it running?

Difficulty · easy Time to first run · 5min

Install the gem and call Chronic.parse with a string, no external dependencies required.

No license information is mentioned in the explanation, so the licensing terms are unknown.

So what is it?

Chronic is a Ruby library that takes human-friendly date and time phrases like "next Friday at 5pm" or "3 years ago" and converts them into structured dates a computer can use. It bridges the gap between how people naturally talk about time and how software needs to store it. When you pass a string to Chronic, it attempts to figure out the date and time you meant. It handles a huge range of formats, from simple expressions like "tomorrow" or "yesterday" to complex ones like "3rd Wednesday in November" or "fourteenth of June 2010 at eleven o'clock in the evening." It is case insensitive, tolerates common misspellings, and handles abbreviations. If it cannot make sense of a phrase, it simply returns nil rather than raising an error. You can also provide context hints, like whether an ambiguous phrase like "monday" should refer to the past or future, and specify how dates should be interpreted. This is useful for anyone building a Ruby app that needs to accept user input about dates in a flexible way. Imagine a task manager where users type "remind me next Tuesday at 3pm" or a scheduling tool where someone enters "last Friday at 20:00." Instead of forcing users to pick dates from a calendar widget or type in a strict format like MM/DD/YYYY, you can let them write naturally and let Chronic sort out what they meant. One notable aspect is its handling of time zones. By default it uses your system's local time zone, but you can plug in a more capable time zone class (like the one from Rails' ActiveSupport) to get full time zone awareness. The README does note a limitation: it relies on Ruby's built-in Time class, so dates outside of that class's supported range will fail to parse and return nil.

Copy-paste prompts

Prompt 1
Add the Chronic gem to my Ruby app and write a helper that parses user-typed date strings like 'next Friday at 5pm' into Time objects, returning nil if the phrase can't be understood.
Prompt 2
Set up Chronic with a context hint so that an ambiguous phrase like 'monday' always refers to the future date, and test it with 'monday', 'tomorrow', and '3rd Wednesday in November'.
Prompt 3
Configure Chronic to use Rails ActiveSupport time zones so phrases like '2pm in Tokyo' are parsed with full time zone awareness instead of relying on the system default.
Prompt 4
Write a small Ruby script using Chronic that accepts a natural-language date phrase from the command line and prints the parsed Time object or 'Could not understand' if Chronic returns nil.

Frequently asked questions

What is chronic?

Chronic is a Ruby library that turns plain-English date and time phrases like 'next Friday at 5pm' into structured dates your app can use, so users never have to fill out a rigid calendar form.

What language is chronic written in?

Mainly Ruby. The stack also includes Ruby.

Is chronic actively maintained?

Dormant — no commits in 2+ years (last push 2023-09-28).

What license does chronic use?

No license information is mentioned in the explanation, so the licensing terms are unknown.

How hard is chronic to set up?

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

Who is chronic for?

Mainly developer.

Open on GitHub → Ask about another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.