Home / Search/ Language Reference/ Functions/ Scalar Functions/ DateTime Functions/endofmonth

endofmonth

The endofmonth function returns the end of the month containing the date, shifted by an offset, if provided.

Syntax

    endofmonth( Date [, Offset] )

Arguments

  • Date: The input date.
  • Offset: An optional number of offset months from the input date (integer, default - 0).

Returns

A datetime representing the end of the month for the given Date value, with the offset, if specified.

Example

  • | project monthEnd = endofmonth(datetime(2022-09-25 10:10:17), 1) returns as 1667260799.999.