isWeekend

Modified on Tue, 22 Aug 2023

Description

Use this function to check if a given date falls on a weekend (Saturday or Sunday). It returns true if the date is a Saturday or Sunday, and false if it is any other day of the week.

Syntax

isWeekend(date)

Returns

Return ValueDescription
True/FalseReturns true if the given date falls on a weekend (Saturday or Sunday), otherwise false.

Sample

ExampleResultDescription
isWeekend(2023-08-13)trueAugust 13th, 2023, is a Saturday, so the function returns true.
isWeekend(2023-08-14)trueAugust 14th, 2023, is a Sunday, so the function returns true.
isWeekend(2023-08-09)falseAugust 9th, 2023, is a Wednesday, so the function returns false.

To view all the Date functions, click here.

See Also