View source: R/date_conversion.R
dateany_to_date | R Documentation |
All values must be converted (without additional NA values created). For
character strings, the year-month-day part is required to be in ISO 8601
format, but the (ignored) time format only requires separation by a
"T"
.
dateany_to_date(x)
x |
An ISO8601 formatted character string, POSIXt object, or Date object |
A Date object
Other Date management and conversion:
generate_dtc()
,
is_ISO8601_calendar_date()
,
is_ISO8601_calendar_datetime()
,
is_ISO8601_ordinal_datetime()
,
is_ISO8601_time()
,
is_ISO8601_timezone()
,
is_ISO8601_week_datetime()
,
make_dy()
,
pattern_ISO8601_any_date()
,
pattern_ISO8601_any_datetime()
,
pattern_ISO8601_calendar_date()
,
pattern_ISO8601_calendar_datetime()
,
pattern_ISO8601_calendar_year()
,
pattern_ISO8601_ordinal_date()
,
pattern_ISO8601_ordinal_datetime()
,
pattern_ISO8601_time()
,
pattern_ISO8601_timezone()
,
pattern_ISO8601_week_date()
,
pattern_ISO8601_week_datetime()
,
sdtm_dtc_to_datetime()
,
sdtm_first_dose()
,
sdtm_time_actual()
dateany_to_date("2022-01-02")
dateany_to_date("2022-01-02T03:04") # the time part is automatically dropped
dateany_to_date(as.Date("2022-01-02"))
dateany_to_date(as.POSIXct("2022-01-02T03:04")) # the time part is still gone
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.