50% off | Unlimited Data & AI Learning
Get 50% off unlimited learning

dttr2 (version 0.5.2)

dtt_excel_to_date_time: Convert Excel date times to date times.

Description

Converts Excel serial date times to date time class.

Usage

dtt_excel_to_date_time(x, tz = dtt_default_tz(), modern = TRUE, ...)

Value

A floored POSIXct vector.

Arguments

x

A vector of numbers to convert.

tz

A string of the time zone.

modern

A flag specifying whether to use the modern or old Excel date system.

...

Unused.

Details

Defaults to the modern Excel date encoding system. Excel for Mac 2008 and earlier Mac versions of Excel use a different date system. If the date 2016-01-01 is represented by 42370, it's the modern system. If it's 40908, it's the old system.

Examples

Run this code
dtt_excel_to_date_time(42370.1234)
dtt_excel_to_date_time(c(1000.1145, 43397.84578))
dtt_excel_to_date_time(45324.1234, tz = "UTC")
dtt_excel_to_date_time(42370.1234, modern = FALSE)

Run the code above in your browser using DataLab