User Guide Cancel

Quarter

 

Description

Calculates the quarter of the year in which a date falls.

Returns

An integer, 1-4.

Category

Date and time functions

Function syntax

Quarter(date)
Quarter(date)
Quarter(date)

See also

DatePartMonth

Parameters

Parameter

Description

date

A date/time object in the range 100 AD-9999 AD.

Usage

When passing a date/time value as a string, enclose it in quotation marks. Otherwise, it is interpreted as a number representation of a date/time object.

Example

<cfscript>
myDatetime = DateFormat(Now());
writeOutput(myDatetime & "<br/>");
writeOutput("Falls on the " & Quarter(myDatetime) & "th quarter");
</cfscript>
<cfscript> myDatetime = DateFormat(Now()); writeOutput(myDatetime & "<br/>"); writeOutput("Falls on the " & Quarter(myDatetime) & "th quarter"); </cfscript>
<cfscript>
    myDatetime = DateFormat(Now());
    writeOutput(myDatetime & "<br/>");
    writeOutput("Falls on the " & Quarter(myDatetime) & "th quarter");
</cfscript>

Output

06-Nov-18
Falls on the 4th quarter

Get help faster and easier

New user?