C
Curt Sampson
I've got an application that goes through apache log files, and one of
the things is does is parse the dates. However, I'm getting mysterious
ocassional failures on what seem to be random lines, different every
time, and a line that wouldn't parse will start parsing when I put it
into a test case.
Here's the stacktrace, in this case I did a "Date.new(2003, 4, 11)":
Exception: Couldn't parse date 2003-4-11 (11/Apr/2003): NaN
/usr/local/lib/ruby/1.8/date.rb:300:in `floor'
/usr/local/lib/ruby/1.8/date.rb:300:in `civil_to_jd'
/usr/local/lib/ruby/1.8/date.rb:568:in `valid_civil?'
/usr/local/lib/ruby/1.8/date.rb:590:in `new'
./HttpLogRecord.rb:83:in `parse_apache_date'
./HttpLogRecord.rb:36:in `parse'
...
This happens both with 1.8.1 and 1.8.2preview2. Any thoughts?
cjs
the things is does is parse the dates. However, I'm getting mysterious
ocassional failures on what seem to be random lines, different every
time, and a line that wouldn't parse will start parsing when I put it
into a test case.
Here's the stacktrace, in this case I did a "Date.new(2003, 4, 11)":
Exception: Couldn't parse date 2003-4-11 (11/Apr/2003): NaN
/usr/local/lib/ruby/1.8/date.rb:300:in `floor'
/usr/local/lib/ruby/1.8/date.rb:300:in `civil_to_jd'
/usr/local/lib/ruby/1.8/date.rb:568:in `valid_civil?'
/usr/local/lib/ruby/1.8/date.rb:590:in `new'
./HttpLogRecord.rb:83:in `parse_apache_date'
./HttpLogRecord.rb:36:in `parse'
...
This happens both with 1.8.1 and 1.8.2preview2. Any thoughts?
cjs