I am working on business analytics application, where I need to fetch some data on per hour basis of a particular month. for example I wanna get the data from jun 01 2012 to jun 30 2012 and I need to fetch the data of every hour between those days.
Like 12:00 13:00,13:00-14:00 ….etc.
How do I do it. Kindly let me know. Using 1.8.7 platform.
If you are using Rails there is a Date method
step: http://corelib.rubyonrails.org/classes/Date.html#M001273On pure ruby just write simple loop:
To simplify use this ruby extension:
Usage:
You can also down-iterate: