Learn R Programming

janitor (version 0.3.0)

excel_numeric_to_date: Convert dates encoded as serial numbers to Date class.

Description

Converts numbers like 42370 into date values like 2016-01-01.

Defaults to the modern Excel date encoding system. However, Excel for Mac 2008 and earlier Mac versions of Excel used a different date system. To determine what platform to specify: if the date 2016-01-01 is represented by the number 42370 in your spreadsheet, it's the modern system. If it's 40908, it's the old Mac system. More on date encoding systems at http://support.office.com/en-us/article/Date-calculations-in-Excel-e7fe7167-48a9-4b96-bb53-5612a800b487.

Usage

excel_numeric_to_date(date_num, date_system = "modern")

Arguments

date_num

numeric vector of serial numbers to convert.

date_system

the date system, either "modern" or "mac pre-2011".

Value

Returns a vector of class Date.

Examples

Run this code
# NOT RUN {
excel_numeric_to_date(40000)
# }

Run the code above in your browser using DataLab