Skip to content

Instantly share code, notes, and snippets.

@miguelmota
Created May 2, 2019 05:24
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save miguelmota/c24238fb82a65ac4d2afd5d9d66f00f1 to your computer and use it in GitHub Desktop.
Save miguelmota/c24238fb82a65ac4d2afd5d9d66f00f1 to your computer and use it in GitHub Desktop.
PostgreSQL timestamp datetime to unix timestamp integer
-- assuming created_at is timestamp column
extract(epoch from created_at)::numeric::integer
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment