to_char ( timestamp, text ) → textConverts time stamp to string according to the given format.
to_char(timestamp '2002-04-20 17:31:12.66', 'HH12:MI:SS') → 05:31:12
Functions / Data Type Formatting Functions
Converts time stamp to string according to the given format.
Reading PG 18current·documented in 27 of 27 versions, 7.1 to 20
to_char ( timestamp, text ) → textConverts time stamp to string according to the given format.
to_char(timestamp '2002-04-20 17:31:12.66', 'HH12:MI:SS') → 05:31:12
to_char ( timestamp with time zone, text ) → textConverts time stamp to string according to the given format.
to_char(timestamp '2002-04-20 17:31:12.66', 'HH12:MI:SS') → 05:31:12
to_char ( interval, text ) → textConverts interval to string according to the given format.
to_char(interval '15h 2m 12s', 'HH24:MI:SS') → 15:02:12
to_char ( numeric_type, text ) → textConverts number to string according to the given format; available for
integer, bigint, numeric, real, double precision.to_char(125, '999') → 125
to_char(125.8::real, '999D9') → 125.8
to_char(-125.8, '999D99S') → 125.80-
Definition snapshot: b7bd9cda · English manual source