I have the following query which I’m unable to solve:
SELECT DISTINCT
m.id,
TO_CHAR(m.date, 'YYYY-MM-DD')::timestamp AS formatted_date,
FROM table.match m
In the formatted_date field I get the following output:
2012-12-02T00:00:00.000Z
Does anyone know how to format it as to get just 2012-12-02?
The version I’m using is: PostgreSQL 13.10
Thank you all for any help!
2
Answers
to get just 2012-12-02 :
to remove time nut still have datetime datatype use date_trunc
If you are going for the
2012-12-02
output, simply castm.date
to date type