G
Guillaume Marcais
Parse Date returns illegal values in a date. Ex:
[gus@comp Ruby]$ ruby -v
ruby 1.8.1 (2003-12-25) [i586-linux-gnu]
[gus@comp Ruby]$ ruby -rparsedate -e 'p ParseDate.parsedate("Monday
2003")'
[nil, 20, 3, nil, nil, nil, nil, 1]
[gus@comp Ruby]$ ruby -rparsedate -e 'p ParseDate.parsedate("Monday
march 2003")'
[nil, 3, 2003, nil, nil, nil, nil, 1]
[gus@comp Ruby]$ ruby -rparsedate -e 'p ParseDate.parsedate("Monday 1st
march 2003")'
[2003, 3, 1, nil, nil, nil, nil, 1]
In the first example, the month is 20 and in the second example, the day
in the month is 2003! Ouch.
The fact that parsedate has a hard time to parse the stupid date I gave
is fine. But I rather get a nil back than an impossible value.
Guilaume.
[gus@comp Ruby]$ ruby -v
ruby 1.8.1 (2003-12-25) [i586-linux-gnu]
[gus@comp Ruby]$ ruby -rparsedate -e 'p ParseDate.parsedate("Monday
2003")'
[nil, 20, 3, nil, nil, nil, nil, 1]
[gus@comp Ruby]$ ruby -rparsedate -e 'p ParseDate.parsedate("Monday
march 2003")'
[nil, 3, 2003, nil, nil, nil, nil, 1]
[gus@comp Ruby]$ ruby -rparsedate -e 'p ParseDate.parsedate("Monday 1st
march 2003")'
[2003, 3, 1, nil, nil, nil, nil, 1]
In the first example, the month is 20 and in the second example, the day
in the month is 2003! Ouch.
The fact that parsedate has a hard time to parse the stupid date I gave
is fine. But I rather get a nil back than an impossible value.
Guilaume.