With theampm, write Time like this in Ruby:
=> 2013-10-08 01:00:00 -0500
=> 2013-10-08 01:30:00 -0500
=> 2013-10-08 16:00:00 -0500
=> 2013-10-08 21:25:00 -0500

# There's also a to_time method
=> 2013-10-08 15:15:00 -0500

This code is so simple I debated even creating a gem for it, but I find myself using it repeatedly for new projects, and now again for Draft, an app to help people write better.


  1. Add gem 'theampm' to your Gemfile.
  2. Run bundle install.
  3. Restart your server


Source code available on Github. Feedback and pull requests are greatly appreciated. Let me know if I can improve this.

P.S. I’d love to meet you on Twitter: here.


Now read this

Writing a Cover Letter

Someone wrote to tell me they really wanted to pay for Draft (I recently turned on paid subscriptions), but they were underemployed and short on cash. However, they were using Draft this very second to write a cover letter for a job... Continue →

Subscribe to Ninjas and Robots

Don’t worry; we hate spam with a passion.
You can unsubscribe with one click.