From: Gordon Thiesfeld Date: 2007-08-01T07:20:00+09:00 Subject: Re: help with string matching > logdate = Date.parse(logdate).to_s > > > => "2007-07-30" > > Would Time#strftime be better? Easier to read, I think. Or if you're using a Date object, you could use Date#strftime. It also looks like you're adding a month to @calendar1, which is easy with a Date object: >> d1 = Date.civil(2007,06,30) => # >> d1.strftime('%Y-%m-%d') => "2007-06-30" >> d2 = d1 >> 1 => # >> d2.strftime('%Y-%m-%d') => "2007-07-30"