diff --git a/datetimes.Rmd b/datetimes.Rmd index be710d8..e393139 100644 --- a/datetimes.Rmd +++ b/datetimes.Rmd @@ -160,6 +160,13 @@ You may want to switch between a date-time and a date. That's the job of `as_dat as_date(now()) ``` +Sometimes you'll get date/times as numeric offsets from the "Unix Epoch", 1970-01-01. If the offset is in seconds, use `as_datetime()`; if it's in days, use `as_date()`. + +```{r} +# as_datetime(60 * 60 * 10) +as_date(365) +``` + ### Exercises 1. What happens if you parse a string that contains invalid dates?