undo_excel_date: Convert an Excel date to a POSIX date

Description Usage Arguments Value Note Examples

View source: R/utils.R

Description

Excel stores dates as an integer representing the number of days since 1/1/1900. Undo that. See http://www.exceltactics.com/definitive-guide-using-dates-times-excel/

Usage

1

Arguments

dates

a vector of dates (either numeric or character) originating from an Excel spreadsheet.

Value

the dates converted to POSIXct objects (see base::DateTimeClasses)

Note

This function is only valid for years 1901 and beyond. Excel wrongly assumes 1900 was a leap year. See base::format.Date() for more information.

Examples

1
2
3
4
undo_excel_date("41659")
#> "2014-01-20 UTC"
undo_excel_date(41534)
#> "2013-09-17 UTC"

LearningToTalk/L2TDatabase documentation built on June 24, 2020, 3:45 a.m.