Gordon Thiesfeld
7/31/2007 10:17:00 PM
> 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)
=> #<Date: 4908563/2,0,2299161>
>> d1.strftime('%Y-%m-%d')
=> "2007-06-30"
>> d2 = d1 >> 1
=> #<Date: 4908623/2,0,2299161>
>> d2.strftime('%Y-%m-%d')
=> "2007-07-30"