I have a file that contains a list of STRING datetime like
Thu Dec 20 00:58:17 +0000 2012
Thu Dec 20 00:50:18 +0000 2012
Thu Dec 20 00:48:53 +0000 2012
Thu Dec 20 00:44:43 +0000 2012
Thu Dec 20 00:42:32 +0000 2012
Each line represents the occurrence of one event.
I want to count the number of events occurred each month (or day).
First, I have converted to DateTime objects. It’s easy.
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?