postgres convert datetime to string code example Example: postgres convert date to string SELECT TO_CHAR(SYSDATE, 'YYYY-MM-DD') FROM dual;