| « February 2012 | ||||||
| S | M | T | W | T | F | S |
| 1 | 2 | 3 | 4 | |||
| 5 | 6 | 7 | 8 | 9 | 10 | 11 |
| 12 | 13 | 14 | 15 | 16 | 17 | 18 |
| 19 | 20 | 21 | 22 | 23 | 24 | 25 |
| 26 | 27 | 28 | 29 | |||
All of the creation methods for the Time class take similar arguments, exemplified here by the Time.local method:
Time.local(year [, month, day, hour, min, sec, usec])
But the ParseDate::parsedate method that does a good job of parsing date information out of human-readable strings returns this array:
[year, mon, mday, hour, min, sec, zone, wday]
You really should be able to type Time.local(*ParseDate::parsedate(timeString)) but you can't. You've got to chop the last two elements off the array first. That's not hard in Ruby, but still ...
So far as I know, there may already be a remedy for this in CVS. But there really ought to be a Time.parsedate(aString) method that does the right thing.