as_year_month_day: Convert to year-month-day

View source: R/gregorian-year-month-day.R

as_year_month_dayR Documentation

Convert to year-month-day

Description

as_year_month_day() converts a vector to the year-month-day calendar. Time points, Dates, POSIXct, and other calendars can all be converted to year-month-day.

Usage

as_year_month_day(x, ...)

Arguments

x

⁠[vector]⁠

A vector to convert to year-month-day.

...

These dots are for future extensions and must be empty.

Value

A year-month-day vector.

Examples

# From Date
as_year_month_day(as.Date("2019-01-01"))

# From POSIXct, which assumes that the naive time is what should be converted
as_year_month_day(as.POSIXct("2019-01-01 02:30:30", "America/New_York"))

# From other calendars
as_year_month_day(year_quarter_day(2019, quarter = 2, day = 50))

clock documentation built on Sept. 11, 2024, 8:39 p.m.