Given are two timestamps in the format YYYYMMDDHH, which are perfectly parseable by DateTime.strptime.
What I want to create is a list of strings in the given format from above in one hour steps, starting from the first date up to the second date.
Example input: 2013011515 and 2013011822.
Expected output: ['2013011515','2013011516','2013011517','2013011518', ... , '2013011820', '2013011820', '2013011821', '2013011822']
Is there any ruby library or core functionality to accomplish this task?
You can use
stepwith an hourly resolution if you use ruby 1.9:Alternatively, on ruby 1.8.7, use a loop