R/e_convert_ExcelDate_to_Date_ALL.R
e_convert_Datetime_to_ExcelDatetime.Rd
Differences between Windows and Mac Serial number date systems
Excel supports two date systems, the 1900 date system and the 1904 date system.
Each date system uses a unique starting date from which all other workbook dates are calculated.
All versions of Excel for Windows calculate dates based on the 1900 date system.
Excel 2008 for Mac and earlier Excel for Mac versions calculate dates based on the 1904 date system.
Excel 2016 for Mac and Excel for Mac 2011 use the 1900 date system, which guarantees date compatibility with Excel for Windows.
For example, July 5, 2011, can have two different serial numbers, as follows:
Date System | Serial number |
1900 | 40729 |
1904 | 39267 |
e_convert_Datetime_to_ExcelDatetime(
datetimes,
origin = "1899-12-30 00:00:00 UTC"
)
list of Datetimes
an origin datetime should correspond to your operating system and version of Excel
datetimes list of numbers
datetimes = c("2011-03-04 06:00:00 UTC", "2011-03-11 07:54:59 UTC", "2011-03-13 07:54:59 UTC")
e_convert_Datetime_to_ExcelDatetime(datetimes)
#> [1] 40606.25 40613.33 40615.33