e_convert_Datetime_to_ExcelDatetime: Convert Datetime to Excel datetime

View source: R/e_convert_ExcelDate_to_Date_ALL.R

e_convert_Datetime_to_ExcelDatetimeR Documentation

Convert Datetime to Excel datetime

Description

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 System Serial number
    1900 40729
    1904 39267

Usage

e_convert_Datetime_to_ExcelDatetime(
  datetimes,
  origin = "1899-12-30 00:00:00 UTC"
)

Arguments

datetimes

list of Datetimes

origin

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

Value

datetimes list of numbers

Examples

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)

erikerhardt/erikmisc documentation built on April 17, 2025, 10:48 a.m.