isThisYear

Modified on Tue, 22 Aug 2023

Description

Use this function to check if a given date falls within the same year as the current date. It returns true if the given date is in the same year as the current date, and false otherwise.

Syntax

isThisYear(date)

Returns

Return ValueDescription
True/FalseReturns true if the given date is in the same year as the current date, otherwise false.

Sample

ExampleResultDescription
isThisYear(2023-08-10)trueAugust 10th, 2023, falls within the same year as the current date, so the function returns true.
isThisYear(2022-09-15)falseSeptember 15th, 2022, does not fall within the same year as the current date, so the function returns false.

To view all the Date functions, click here.

See Also