Ever looked at your app’s date output and thought, “This is too predictable”? Yeah, me neither. But here we are.
I’m releasing strftime_roulette, a Ruby gem that adds a strftime_roulette method to Date and Time objects. Every call returns a randomly formatted string. That’s it. That’s the gem.
Why?
Why not?
How it Works
require 'strftime_roulette'
Date.today.strftime_roulette
# => "2026-01-16 12:00:00"
Date.today.strftime_roulette
# => "January 16, 2026 12:00 AM"
Date.today.strftime_roulette
# => "01/16/2026 12:00:00"
Each call picks a random format. You never know what you’re gonna get.
Filter by Category
Want only date formats? Only time formats? You can do that:
Time.now.strftime_roulette(:time)
# => "14:30:45"
# => "2:30 PM"
# => "14:30"
Date.today.strftime_roulette(:date)
# => "Thu Jan 16"
# => "January 16, 2026"
# => "01-16-2026"
Go Atomic
Pass single: true to get output from a single strftime directive:
Date.today.strftime_roulette(:date, single: true)
# => "Thursday" # or "16" or "January" or "2026"
Time.now.strftime_roulette(:time, single: true)
# => "PM" # or "45" or "14" or "UTC"
Practical Uses
- Annoying your coworkers
- Testing if your UI handles various date formats gracefully
- Adding chaos to your development environment
- Making QA question their sanity
Installation
gem 'strftime_roulette'
Disclaimer
Please do not use this in production. Unless you want to. I’m not your boss.
GitHub | MIT License