end of month
the end of month for a given datetime
(datetime subject, long addMonths) -> datetime
Returns the datetime representing the end of month for given subject
. The time component of subject
is preserved in the result.
If addMonths
is non-zero, the given amount of months is added to subject
first and the end of month of the resulting datetime is returned. Use negative values for addMonths
to go back in time.
Returns nil
if any argument is nil
.
Parameters
Name | Type | Description |
---|---|---|
subject |
datetime | The datetime to work with |
addMonths |
long |
The offset in months to add to subject before determining end of month. |