From: "Florian Aßmann" Date: 2007-09-03T06:26:21+09:00 Subject: Re: extract a range start/end? Hi Michael, > opts = OptionParser.new do |opts| > opts.on("-s", "--startdate", "What start date to use." do |i| > #code to determine to use the starting date # see Parsedate#parsedate at http://www.ruby-doc.org/stdlib/libdoc/parsedate/rdoc/classes/ParseDate.html#M001494 @startdate = Parsedate.parsedate i > end > i was thinking i could possibly create a new range depending on what the > user input was by doing > > require 'date' > results = [] # delete this > > (Date.new(2007,4,1)..Date.new(2007,4,8)).each {|r| res << r} result = (@startdate..@enddate).to_a > but then how would i match that against the original dates for the data? match = original & result Oyasumi Florian