Convert date to day of year in Postgres
Asked Answered
M

1

10

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

Meunier answered 3/9, 2015 at 14:58 Comment(0)
M
24

Use the extract function:

select extract(doy from the_date_column)
from the_table
Match answered 3/9, 2015 at 15:1 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.