Mention numeric offsets from epoch

This commit is contained in:
hadley 2016-08-15 09:53:14 -05:00
parent 6e3eacc342
commit e6eb0d65d8
1 changed files with 7 additions and 0 deletions

View File

@ -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?