Skip to content

getFirstDayOfMonth

The getFirstDayOfMonth() function returns the first day of the month (in TheDate format) for the given date.

Interactive example

Syntax

typescript
function getFirstDayOfMonth(
	input: TheDate
): TheDate

Parameters

  • input: TheDate for which to find the first day of the month.

Return value

A TheDate set to the first day of the month (at midnight UTC).

See also

Sources

Released under the MIT license.