10

How can I convert a column with a date e.g. '2012-08-03' to the day of year in Postgres?

Jean-François Savard
  • 20,626
  • 7
  • 49
  • 76
anna
  • 195
  • 2
  • 9

1 Answers1

25

Use the extract function:

select extract(doy from the_date_column)
from the_table