setQuarter
Modified on Tue, 22 Aug 2023
Description
Use this function to set the year quarter to the given date. The quarter parameter allows you to specify the desired quarter (1, 2, 3, or 4), and the function will return the resulting date with the corresponding quarter.
Syntax
setQuarter(date, quarter)
Returns
Return Value | Description |
---|---|
Date | Return the resulting date. |
Sample
Example | Result |
---|---|
setQuarter(2023-4-10, 2) | The output shows the resulting date, which is October 1 of the respective quarter. |
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