isYesterday

Modified on Tue, 22 Aug 2023

Description

Use this function to check if a given date represents yesterday. It returns true if the date is the day immediately before the current date, and false otherwise.

Syntax

isYesterday(date)

Returns

Return ValueDescription
True/FalseReturns true if the given date represents yesterday, otherwise false.

Sample

ExampleResultDescription
isYesterday(2023-08-08)trueAugust 8th, 2023, is the day immediately before the current date, so the function returns true.
isYesterday(2023-08-09)falseAugust 9th, 2023, is not the day immediately before the current date, so the function returns false.
isYesterday(2023-08-07)falseAugust 7th, 2023, is not the day immediately before the current date, so the function returns false.

To view all the Date functions, click here.

See Also