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 Value | Description |
---|---|
Date | Returns a Date object representing the start of the year quarter for the given date in the local timezone. |
Sample
Example | Result | Description |
---|---|---|
startOfQuarter(2023-06-15) | 2023-04-01 | The 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-01 | The 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-01 | The 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
Was this article helpful?
That’s Great!
Thank you for your feedback
Sorry! We couldn't be helpful
Thank you for your feedback
Feedback sent
We appreciate your effort and will try to fix the article