timeConv: Convert times from numbers to POSIXct

View source: R/timeConv.R

timeConvR Documentation

Convert times from numbers to POSIXct

Description

Since data imported from Excel often changes date and time data to numeric, timeConv converts dates from decimal numbers to Date with a time zone of "UTC" unless otherwise specified.

Usage

timeConv(x, tz = "UTC", dataSource = "Excel")

Arguments

x

A numeric string

dataSource

dataSource Either "Excel" (default) or "Unix" depending on where the data are coming from. Excel data have an origin of Dec. 30, 1899 whereas Unix or R data have an origin of Jan. 1, 1970.

Value

Returns a POSIXct object

Examples

timeConv(43252.5)
# "2018-06-01 12:00:00 UTC"

timeConv(18526.2356, dataSource = "R")
# "2020-09-21 05:39:15 UTC"


shirewoman2/LaurasHelpers documentation built on Oct. 22, 2023, 2:07 p.m.