Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. Ruby
  3. stamp

stamp

MITRuby

A Ruby gem that formats dates and times using human-friendly example strings instead of strftime directives.

GitHubGitHub
960 stars17 forks0 contributors

What is stamp?

Stamp is a Ruby gem that formats dates and times by using example strings as templates instead of traditional strftime directives. It solves the problem of memorizing complex format codes by allowing developers to provide a human-readable example (like "March 1, 1999") and automatically applying that format to their dates and times.

Target Audience

Ruby developers who work with date and time formatting in their applications, particularly those who find strftime directives difficult to remember or read in code.

Value Proposition

Developers choose Stamp because it makes date formatting more intuitive and maintainable—code becomes self-documenting with clear example strings, reducing the cognitive load of format specifiers.

Overview

Date and time formatting for humans.

Use Cases

Best For

  • Formatting dates in Ruby without memorizing strftime codes
  • Making date/time formatting code more readable and self-documenting
  • Configuring Rails date formats with human-friendly examples
  • Including static text alongside formatted dates (e.g., labels like 'DOB:')
  • Handling ordinal day formatting (like '1st', '2nd', '3rd')
  • Quickly prototyping date formats by copying example strings

Not Ideal For

  • Applications requiring locale-specific date formats beyond English examples
  • Projects that depend on untested DateTime behavior for critical functionality
  • High-performance scenarios where the overhead of parsing example strings is prohibitive

Pros & Cons

Pros

Intuitive Example-Based Formatting

Uses human-readable examples like 'March 1, 1999' instead of cryptic strftime codes, making code self-documenting and easier to maintain, as shown in the usage examples.

Flexible Text and Ordinal Support

Recognizes ordinal days (e.g., '5th') and preserves extraneous text (e.g., 'DOB:'), demonstrated in the stamp method examples for dates and times.

Seamless Rails Integration

Easily configures Rails date formats using Stamp's examples, as highlighted in the Rails integration section with DATE_FORMATS configuration.

Time Zone Abbreviation Recognition

Supports standard time zone abbreviations like UTC, PST, and EST, making time formatting straightforward without additional parsing.

Cons

Ambiguity in Example Parsing

The README admits that examples like '01/09' can be ambiguous, forcing developers to use explicit values to avoid confusion, which reduces intuitiveness.

Untested DateTime Support

Stamp's integration with DateTime is not thoroughly tested, as noted in the limitations, posing risks for applications relying on DateTime objects.

English-Centric Formatting

Relies on English month and weekday names in examples, limiting its usefulness for international applications requiring multi-language or locale-specific formats.

Frequently Asked Questions

Quick Stats

Stars960
Forks17
Contributors0
Open Issues0
Last commit1 month ago
CreatedSince 2011

Tags

#human-readable#developer-tools#datetime#ruby-gem#time-formatting#rails-integration#date-formatting

Built With

R
Ruby

Included in

Ruby14.1k
Auto-fetched 9 hours ago

Related Projects

groupdategroupdate

The simplest way to group temporal data

Stars3,885
Forks240
Last commit23 days ago
chronicchronic

Chronic is a pure Ruby natural language date parser.

Stars3,252
Forks449
Last commit2 years ago
ice_cubeice_cube

Ruby Date Recurrence Library - Allows easy creation of recurrence rules and fast querying

Stars2,465
Forks354
Last commit7 months ago
local_timelocal_time

Rails engine for cache-friendly, client-side local time

Stars2,001
Forks125
Last commit1 month ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub