From: Dan Daniels Date: 2007-08-01T08:31:08+09:00 Subject: Re: help with string matching Gordon Thiesfeld wrote: > > Ahh, I made some pretty bad assumptions about what you were trying to > do. I'm sorry. > >> So, how would you parse a date formated as 2007730 into 2007-06-30? I >> know that I could parse it out manually, but I'm assuming there is a >> more elegant solution. >> > > I guess I would do this: > > Date.civil(@calendar1.year, @calendar1.date + 1, @calendar1.day).to_s Oh, no. Your suggestions were great. I combined your earlier suggestions and came up with this: logdate = Time.local(@calendar1.year, @calendar1.month + 1,@calendar1.day).strftime('%Y-%m-%d').to_s which works the same as what you just mentioned: logdate = Date.civil(@calendar1.year, @calendar1.month + 1, @calendar1.day).to_s Thanks a ton! Dan -- Posted via http://www.ruby-forum.com/.