Topic: Date weirdness

Just ran into something weird:

d = Date.parse('18 march 2009')
puts "day:#{d.day} month: #{d.month} year:#{d.year}"
day:18 month:3 year:2009

Everything as expected. Being a finnish guy that I am, I wanted to try out the same in Finnish:

d = Date.parse('18 maalis 2009')
puts "day:#{d.day} month: #{d.month} year:#{d.year}"
day:18 month:3 year:2010

Wait, what? Otherwise OK, no errors, the right month (somehow?), but why on earth is the year wrong?

Re: Date weirdness

I believe what is happening is that it cannot parse the month, so it stops and defaults the remaining variables to the current month/year. It has already figured out the day, so that is fine. You can see this by change to the year...no matter what you use, it will return 2010.