setYear
Modified on Tue, 22 Aug 2023
Description
Use this function to set the year to the given date. You can specify the desired year using the "year" parameter. The function will return the resulting date with the specified year.
Syntax
setYear(date, year)
Returns
Return Value | Description |
---|---|
Date | Return the resulting date. |
Sample
Example | Result | Description |
---|---|---|
setYear(2023-4-10, 2024) | 2024-04-10 | Set the year to 2024. |
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