Skip to content

Instantly share code, notes, and snippets.

@cacheflow
Created June 11, 2019 20:44
Show Gist options
  • Save cacheflow/b4a75009858258bc6d9d34bc355d4573 to your computer and use it in GitHub Desktop.
Save cacheflow/b4a75009858258bc6d9d34bc355d4573 to your computer and use it in GitHub Desktop.
i = 0
j = 24 * 30
first_hour = 4
end_hour = 5
h = {}
while(i < j) do
start_time = Time.current.beginning_of_hour + first_hour.hours
end_time = Time.current.beginning_of_hour + end_hour.hours
first_hour +=1
end_hour +=1
h[start_time] = end_time
i+=1
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment