date_part ( text, timestamp ) → double precisionGet timestamp subfield (equivalent to
extract); see Section 9.9.1date_part('hour', timestamp '2001-02-16 20:38:40') → 20Get timestamp subfield (equivalent to extract); see Section 9.9.1
date_part ( text, timestamp ) → double precisionGet timestamp subfield (equivalent to
extract); see Section 9.9.1date_part('hour', timestamp '2001-02-16 20:38:40') → 20date_part ( text, interval ) → double precisionGet interval subfield (equivalent to
extract); see Section 9.9.1date_part('month', interval '2 years 3 months') → 3date_part('field', source)Note that here the field parameter needs to be a string value, not a name. The valid field names for date_part are the same as for extract. For historical reasons, the date_part function returns values of type double precision. This can result in a loss of precision in certain uses. Using extract is recommended instead.Definition snapshot: 2026-09-14T13:14:25.684213+00:00@99e6866c · English manual source