Skip to content

Instantly share code, notes, and snippets.

@camilo
Created June 26, 2012 18:15
Show Gist options
  • Select an option

  • Save camilo/2997671 to your computer and use it in GitHub Desktop.

Select an option

Save camilo/2997671 to your computer and use it in GitHub Desktop.
((date_part('hour', created_at))::integer % 3))::varchar) || ' hours'))::interval)
-- created_at is a timestamp without timezone
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment