Dates of a time series from Excel to R

When I import a financial time series from Excel to R, the dates turn into integers. Each column represents a date. I understand that Excel converted them to a form where they represent the number of days since the origin date of 01/01/1900.
How can I turn these numbers back into 'normal' dates in R?

Use as.Date() and specify the origin

dates <- 42917:42918
as.Date(dates, origin = "1899-12-30")
#> [1] "2017-07-01" "2017-07-02"

If you need more specific help, please provide a proper REPRoducible EXample (reprex) illustrating your issue.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.