Project

timerator

0.0
No commit activity in last 3 years
No release in over 3 years
timerator takes a start and end Time and allows the programmer to iterate for different segments of time
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies
 Project Readme

timerator

timerator is a time computing library written that allows you to work with date ranges in smaller chunks

example

Timerator.new(Time.gm(2000,"jan",1), Time.gm(2000,"jan",10)).each(:day) do |beginning,ending|
  puts "#{beginning} - #{ending}"
end

=>

Sat Jan 01 00:00:00 UTC 2000..Sun Jan 02 00:00:00 UTC 2000  
Sun Jan 02 00:00:00 UTC 2000..Mon Jan 03 00:00:00 UTC 2000  
Mon Jan 03 00:00:00 UTC 2000..Tue Jan 04 00:00:00 UTC 2000  
Tue Jan 04 00:00:00 UTC 2000..Wed Jan 05 00:00:00 UTC 2000  
Wed Jan 05 00:00:00 UTC 2000..Thu Jan 06 00:00:00 UTC 2000  
Thu Jan 06 00:00:00 UTC 2000..Fri Jan 07 00:00:00 UTC 2000  
Fri Jan 07 00:00:00 UTC 2000..Sat Jan 08 00:00:00 UTC 2000  
Sat Jan 08 00:00:00 UTC 2000..Sun Jan 09 00:00:00 UTC 2000  
Sun Jan 09 00:00:00 UTC 2000..Mon Jan 10 00:00:00 UTC 2000  

notes

supports seconds, minutes, hours, days, and weeks