Nitobi
About Nitobi
Services
Products
Home -> Blogs -> Brian@Nitobi

Brian@Nitobi

Enumerate a range of dates with Ruby

May 5th, 2008

Quick snippet, having fun with dates.


require 'rubygems'
require 'activesupport'

date_range = (DateTime.now-10.days)..DateTime.now

date_range.each { |e| puts e }

Digg! | Del.icio.us

This entry was posted on Monday, May 5th, 2008 at 4:14 pm and is filed under Uncategorized. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

One Response to “Enumerate a range of dates with Ruby”

  1. Alexei Says:

    AGAIN this was useful! Thanks for blogging it.

Leave a Reply


Search Posts

Pages

Archives

Categories

All contents are (c) Copyright 2006, Nitobi Software Inc. All rights Reserved
Brian@Nitobi Entries (RSS) and Comments (RSS).