Learn R Programming

quantdates (version 2.0.4)

LastDayOfMonth: LastDayOfMonth

Description

Returns the last day of a month.

Usage

LastDayOfMonth(year, month, date = NULL)

Value

Last day of the month in the current year.

Arguments

year

Year as a number.

month

Month as a number.

date

If provided, uses year and month from this date. It could be date or a string format date YYYY-MM-DD.

Author

Diego Jara

Examples

Run this code
# Return last day of the month in year
LastDayOfMonth(year = 2020, month = 2)

# Return last day of the month for the date
LastDayOfMonth(date = '2020-02-03')

Run the code above in your browser using DataLab