Range based on DateTime : Date Range « Range « Ruby






Range based on DateTime


require 'date'

span = DateTime.new(1776, 7, 2, 1, 30, 15)..DateTime.new(1776, 7, 4, 7, 0, 0)
span.each { |x| puts x }

 








Related examples in the same category

1.Iterating Over Dates
2.Range based on Time
3.DateTime Range