Course
Simulator
More
Premium
Log in
PostgreSQL Function Reference
Functions
TO_CHAR
TO_CHAR
Converts a date/time or number to a string according to the format.
PostgreSQL 17.5
TO_CHAR
(
timestamp
,
format
)
timestamp
The value to convert.
format
The format string.
Examples
PostgreSQL 17.5
SELECT
TO_CHAR
(
NOW
(
)
,
'YYYY-MM-DD'
)