From: Ana Bia Date: 2013-05-01T03:02:11+09:00 Subject: Re: how to: convert string to DateTime object tamouse mailing lists wrote in post #1107404: > On Tue, Apr 30, 2013 at 12:54 PM, tamouse mailing lists > wrote: >>> -and how to run an each loop to convert multiple strings >> DEBUG 2013-04-23T17:27:50-05:00 "Dalli::Server#connect 127.0.0.1:11211" >> specified by database.yml >> >> And you want to extract the time stamps from that and convert them to >> DateTime objects. The following might be a way to do that: >> >> IO.foreach("./log/development.log") do |line| >> timestamp = DateTime.strptime(line.split[1]),'%FT%T%z') >> end > > Opps, assume that log file didn't wrap and the DEBUG ... > are all on one line. thank you, this helps, it's close to what I'm looking for -- Posted via http://www.ruby-forum.com/.