From: Ryan Davis Date: 2012-11-29T19:09:38+09:00 Subject: Re: Trouble with Chronic On Nov 29, 2012, at 01:45 , Joel Pearson wrote: > I've decided to try Chronic to make it easier (hopefully) to get certain > dates. > I've gotten most of the way there, I'm just stuck on the syntax for the > last day of last month. > > Chronic.parse('first day of last month') > => 2012-10-01 > > That works, but I've tried 'end day of last month', 'final day of last > month', 'last day of last month', and many others. I just can't work out > the syntax it needs. I don't see how throwing tons of code at something so basic is (that much) easier: ruby19 -rdate -e 't = Date.today; puts t - t.day' To really get the point across, look at how much it does to calculate this: ruby19 -rtracer -rdate -e 't = Date.today; puts t - t.day' vs: ruby19 -rtracer -e 'require "chronic"; Chronic.parse("first day of this month") - 86400'