I want to convert timestamp column to the following format in PostgreSQL:
2/28/2018
I've tried:
to_char((sr.created_at), 'MM/DD/YYYY')
but that gives me:
02/28/2018
Is there way to do that in PostgreSQL?
You may use the FM prefix to suppress leading zeroes.
knayak=# select TO_CHAR(DATE '2019-01-01','FMMM/FMDD/YYYY');
to_char
----------
1/1/2019
(1 row)
0?1/1/2019or1/01/2019?