Description:-

This is used to get the quarter of the year in which the given date falls.

quarter( date );

This function returns an integer value, which will be between 1 to 4.

Member Function Syntax:-

date.quarter( );

Attributes:-

date:- This is a required argument, A date/time object in the range 100 AD9999 AD.

Example:-

writeoutput( "`2025-07-25` this date falls on the #quarter( "2025-07-25" )#th quarter of 2025 year." );

Result:-

`2025-07-25` this date falls on the 3th quarter of 2025 year.

Example with member syntax:-

var dateObject = "2025-07-25";
writeoutput( "`2025-07-25` this date falls on the #dateObject.quarter( )#th quarter of 2025 year." );

Result:-

`2025-07-25` this date falls on the 3th quarter of 2025 year.