QUARTER

Returns calendar quarter of the specified date as an integer, where the January-March quarter is 1.

Returns calendar quarter of the specified date as an integer, where the January-March quarter is 1.

Syntax

QUARTER ( date )

Behavior type

  • Immutable if thespecified date is a TIMESTAMP, DATE, or VARCHAR.

  • Stable if the specified date is aTIMESTAMPTZ

Parameters

date

The date to process, one of the following data types:

Examples

=> SELECT QUARTER (TIMESTAMP 'sep 22, 2011 12:34');
 QUARTER
---------
       3
(1 row)