epoch2Datetime: Change Epoch Time to Datetime

View source: R/epoch2Datetime.R

epoch2DatetimeR Documentation

Change Epoch Time to Datetime

Description

[Stable]

Converts epoch time to a POSIXct/datetime. This is a common task when reading in data with dates from an ESRI REST API.

Usage

epoch2Datetime(epochDate, milliseconds = TRUE)

Arguments

epochDate

numeric vector with the epoch date

milliseconds

Should you complete millisecond conversion? Default is TRUE

Value

Vector of class POSIXct

Creation notes

First created in 2020-Sept in conjunction with my pull request to esri2sf to add the esri2df function

Author(s)

Jacob Peterson

Examples

## Not run: 
# devtools::install_github('yonghah/esri2sf')
library(esri2sf)

esriData <- esri2sf::esri2df(url = 
"https://gis2.marc2.org/arcgis/rest/services/HumanServices/COVIDv2/MapServer/5")
class(esriData$Date)

class(epoch2Datetime(esriData$Date))

## End(Not run)

MARC-KC/marcR documentation built on June 2, 2022, 9:31 p.m.