Skip to contents

The origin date behind each Excel date system

Usage

excel_origin(date_system = c("1900", "1904"))

Arguments

date_system

"1900" or "1904".

Value

A length-one Date.

Details

Excel's 1900 system counts 1900-01-01 as day 1 but also includes the non-existent 1900-02-29, so an origin of 1899-12-30 reproduces what Excel displays for every serial from 61 onward. The 1904 system, inherited from early Macintosh versions, counts 1904-01-01 as day 0.

Examples

excel_origin("1900")
#> [1] "1899-12-30"
as.Date(45746, origin = excel_origin("1900"))
#> [1] "2025-03-30"