Skip to content

Instantly share code, notes, and snippets.

@tpitale
Created March 11, 2015 17:49
Show Gist options
  • Save tpitale/39e97ef1ca24e968dd35 to your computer and use it in GitHub Desktop.
Save tpitale/39e97ef1ca24e968dd35 to your computer and use it in GitHub Desktop.
> result = Purchase.repository.adapter.select("SELECT transaction_time, transaction_time::text AS transaction_time_text FROM purchases WHERE id = 2460").first
> result.transaction_time_text.to_datetime.strftime("%L") # => "905"
> result.transaction_time.to_datetime.strftime("%L") # => "000"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment