startOfDecade
Modified on Tue, 22 Aug 2023
Description
Use this function to obtain the start date of the decade for a given date. It returns the date that marks the beginning of the decade in which the input date falls.
Syntax
startOfDecade(date)
Returns
Return Value | Description |
---|---|
Date | Returns a Date object representing the start of the decade for the given date. |
Sample
Example | Result | Description |
---|---|---|
startOfDecade(2023-06-15) | 2020-01-01 | The function returns the start of the decade for June 15, 2023, which is January 1, 2020. |
startOfDecade(1990-12-31) | 1990-01-01 | The function returns the start of the decade for December 31, 1990, which is January 1, 1990. |
startOfDecade(1975-09-05) | 1970-01-01 | The function returns the start of the decade for September 5, 1975, which is January 1, 1970. |
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