Differences between Windows and Mac Serial number date systems

  • https://support.microsoft.com/en-us/office/date-systems-in-excel-e7fe7167-48a9-4b96-bb53-5612a800b487#ID0EAACAAA=Windows

    • 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 SystemSerial number
    190040729
    190439267
e_convert_ExcelDate_to_Date(dates, origin = "1899-12-30")

Arguments

dates

list of integers

origin

an origin date should correspond to your operating system and version of Excel

Value

dates list of Dates

Examples

dates <- 42917:42919
e_convert_ExcelDate_to_Date(dates)
#> [1] "2017-07-01" "2017-07-02" "2017-07-03"