Skip to content

Instantly share code, notes, and snippets.

@greatseth
Created November 17, 2008 05:38
Show Gist options
  • Select an option

  • Save greatseth/25666 to your computer and use it in GitHub Desktop.

Select an option

Save greatseth/25666 to your computer and use it in GitHub Desktop.
next_hour = begin
Time.mktime( Time.now.year, Time.now.month, Time.now.day, Time.now.hour+1 )
rescue ArgumentError
# this will keep it from failing when run between 11pm and midnight :\
Time.mktime( Time.now.year, Time.now.month, Time.now.day+1, Time.now.hour+1 )
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment