startOfQuarter

Modified on Tue, 22 Aug 2023

Description

Use this function to obtain the start date of a year quarter for a given date. The result will be in the local timezone, and it represents the first day of the quarter in which the input date falls.

Syntax

startOfQuarter(date)

Returns

Return ValueDescription
DateReturns a Date object representing the start of the year quarter for the given date in the local timezone.

Sample

ExampleResultDescription
startOfQuarter(2023-06-15)2023-04-01The function returns the start of the year quarter for June 15, 2023, which is April 1, 2023, in the local timezone.
startOfQuarter(1990-12-31)1990-10-01The function returns the start of the year quarter for December 31, 1990, which is October 1, 1990, in the local timezone.
startOfQuarter(1975-09-05)1975-07-01The function returns the start of the year quarter for September 5, 1975, which is July 1, 1975, in the local timezone.

To view all the Date functions, click here.

See Also