From: "Carlo E. Prelz" Date: 2012-12-26T16:49:47+09:00 Subject: Re: Accumulate total count for each month Subject: Accumulate total count for each month Date: Wed 26 Dec 12 12:16:26PM +0900 Quoting Soichi Ishida (lists@ruby-forum.com): > Normally, when counting the number of each word occurred in a file, > using hash can help (each word as a key). But this case, it is not that > simple because the key is date object. > > Do you have better ideas for counting the number of events each > month? Why not use the year+month as the hash key? From your DateTime object, you obtain an appropriate string with dt.strftime('%Y%m'). Carlo -- * Se la Strada e la sua Virtu' non fossero state messe da parte, * K * Carlo E. Prelz - fluido@fluido.as che bisogno ci sarebbe * di parlare tanto di amore e di rettitudine? (Chuang-Tzu)