Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Table plus
applyColStyleToCelltrue
heading0
columnTypess,s,s,s
multiplefalse
columnAttributesstyle="background:#e5e7ea;font-weight:bold,,style="background:#e5e7ea;font-weight:bold,
enableSortingfalse

Syntax

endOfMonth(date)

Package

Alias

Pkg Usage

Description

Excerpt
hiddentrue
Returns a date set on the last day of the month for the given date.

Returns a date set on the last day of the month for the given date. Also sets hours / minutes / seconds / milliseconds to their respective maximum value.

Parameters

Table plus
applyColStyleToCelltrue
columnTypess,s,s,s
heading0
multiplefalse
enableSortingfalse

Parameter name

Type

Required

Description

date

Date

Yes

Specifies a Date expression.

Return Type

Date

Example

Code Block
languagejs
function endOfMonthToDesc(date d){
    desc += "End of month for date " + d + " is " + endOfMonth(d) + "\n";
}
desc = "";
endOfMonthToDesc("2013-01-26 20:19:18");
endOfMonthToDesc("2013-02-01 20:19:18");
endOfMonthToDesc("2012-02-01 20:19:18");
endOfMonthToDesc("2013-02-28 20:19:18");
endOfMonthToDesc("2012-02-29 20:19:18");
endOfMonthToDesc("2012-12-31 23:59:59");
endOfMonthToDesc("2012-12-31 00:00:00");
endOfMonthToDesc("2012-12-01 23:59:59");
endOfMonthToDesc("2012-12-01 00:00:00");

Outputs to description:
End of month for date 2013-01-26 20:19:18 is 2013-01-31 23:59:59
End of month for date 2013-02-01 20:19:18 is 2013-02-28 23:59:59
End of month for date 2012-02-01 20:19:18 is 2012-02-29 23:59:59
End of month for date 2013-02-28 20:19:18 is 2013-02-28 23:59:59
End of month for date 2012-02-29 20:19:18 is 2012-02-29 23:59:59
End of month for date 2012-12-31 23:59:59 is 2012-12-31 23:59:59
End of month for date 2012-12-31 00:00:00 is 2012-12-31 23:59:59
End of month for date 2012-12-01 23:59:59 is 2012-12-31 23:59:59
End of month for date 2012-12-01 00:00:00 is 2012-12-31 23:59:59

See also

Filter by label (Content by label)
showLabelsfalse
max25
showSpacefalse
cqllabel = "date_routine" and space = currentSpace ( )
labelsarray_routines