Skip to content

Instantly share code, notes, and snippets.

@barsbek
Created March 16, 2018 11:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save barsbek/e8c1da29f6d7653a1f6458a613782833 to your computer and use it in GitHub Desktop.
Save barsbek/e8c1da29f6d7653a1f6458a613782833 to your computer and use it in GitHub Desktop.
postgresql: extract month from date
select date_part('month', '2011-10-22'); -- 10
select extract(month from '2011-12-22'); -- 12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment