x <- date_time_parse("2019-01-01 23:02:03", "America/New_York")
# R's `as.Date.POSIXct()` method defaults to changing the printed time
# to UTC before converting, which can result in odd conversions like this:
as.Date(x)
# `as_date()` will never change the printed time before converting
as_date(x)
# Can also convert from other clock types
as_date(year_month_day(2019, 2, 5))
Run the code above in your browser using DataLab