setDay

Modified on Tue, 22 Aug 2023

Description

Use this function to set the day of the week to the given date.

Syntax

setDay(date, day, options)

Returns

Return ValueDescription
DateReturn the resulting date.

Sample

ExampleResultDescription
setDay (2023-3-1, "friday", dayOfWeekToSet = 3)Wed March 01 2023Returns output as: Wed March 01 2023.

To view all the Date functions, click here.

See Also