Skip to content

Instantly share code, notes, and snippets.

@seabre
Created December 7, 2011 19:58
Show Gist options
  • Select an option

  • Save seabre/1444349 to your computer and use it in GitHub Desktop.

Select an option

Save seabre/1444349 to your computer and use it in GitHub Desktop.
Format Time in Ruby for SQL Datetime Comparison
#Gets current time, then formats current time for SQL.
Time.now.to_s(:db)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment