epoch2Datetime: Change Epoch Time to Datetime

Description Usage Arguments Value Creation notes Author(s) Examples

View source: R/epoch2Datetime.R

Description

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

Usage

1
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

1
2
3
4
5
6
7
8
9
## Not run: 
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-GIS/marcR documentation built on Nov. 16, 2020, 1:41 p.m.