Skip to content
masterclass Buddy

PostgreSQL · Function

extract

EXTRACT reads a chosen part of a date, time, timestamp, or interval. It returns that part as a numeric value.

Last updated

Syntax

EXTRACT(field FROM source)

In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.

Subscribe
  • date_part
  • date_trunc
  • to_timestamp
  • isoyear
  • week

Source: PostgreSQL: Documentation: 18: 9.9. Date/Time Functions and Operators. Checked 2026-11-03.