getDateOrigin: Get the date origin an xlsx file is using

Description Usage Arguments Details Value Author(s) See Also Examples

Description

Return the date origin used internally by an xlsx or xlsm file

Usage

1
getDateOrigin(xlsxFile)

Arguments

xlsxFile

An xlsx or xlsm file.

Details

Excel stores dates as the number of days from either 1904-01-01 or 1900-01-01. This function checks the date origin being used in an Excel file and returns is so it can be used in convertToDate

Value

One of "1900-01-01" or "1904-01-01".

Author(s)

Alexander Walker

See Also

convertToDate

Examples

1
2
3
4
5
6
7
## create a file with some dates
write.xlsx(as.Date("2015-01-10") - (0:4), file = "getDateOriginExample.xlsx")
m <- read.xlsx("getDateOriginExample.xlsx")

## convert to dates
do <- getDateOrigin(system.file("readTest.xlsx", package = "openxlsx"))
convertToDate(m[[1]], do)


Search within the openxlsx package
Search all R packages, documentation and source code

Questions? Problems? Suggestions? or email at ian@mutexlabs.com.

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.