convertDate: Convert Various Formats to Date

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

Description

Convert dates in external formats (e.g. from MATLAB) to Date or POSIXct.

Usage

1
convert_date(x, type, fraction = FALSE, tz = "")

Arguments

x

numeric

type

character: currently "excel" and "matlab" are supported.

fraction

logical: should fractional dates (i.e. times) be used? Default is FALSE.

tz

character: if fraction is TRUE, then what time zone is to be assumed? Default is "", i.e. the local time zone.

Details

Convert the numeric representation of a date to class Date. For Excel, only the Windows format is supported. Note that dates before 1 March 1900 are probably wrong since Excel considers 1900 a leap year (which it is not).

Value

A vector of class Date, or POSIXct if fraction is TRUE.

Author(s)

Enrico Schumann

See Also

as.Date

Examples

1
convert_date(40000, "excel")

datetimeutils documentation built on March 18, 2018, 2:30 p.m.