Get First / Last Day of a Month
Get First or Last Day of Month From Year and Month
first_of_month(x) # S3 method for default first_of_month(x) last_of_month(x) # S3 method for default last_of_month(x) first_of_ym(x, m = NULL) last_of_ym(x, m = NULL)
x | Anything that can be coerced to a date with |
---|---|
m | Two integer (vectors).
|
a Date
first_of_month()
first_of_month("2016-06-04")#> [1] "2016-06-01"last_of_month("2016-06-04")#> [1] "2016-06-30"first_of_ym(2016, 1)#> [1] "2016-01-01"first_of_ym(201601)#> [1] "2016-01-01"