Learn R Programming

rerddap (version 1.2.0)

convert_time: Convert a UDUNITS compatible time to ISO time

Description

Convert a UDUNITS compatible time to ISO time

Usage

convert_time(
  n = NULL,
  isoTime = NULL,
  units = "seconds since 1970-01-01T00:00:00Z",
  url = eurl(),
  method = "local",
  ...
)

Arguments

n

numeric; A unix time number.

isoTime

character; A string time representation.

units

character; Units to return. Default: "seconds since 1970-01-01T00:00:00Z"

url

Base URL of the ERDDAP™ server. See eurl() for more information

method

(character) One of local or web. Local simply uses as.POSIXct(), while web method uses the ERDDAP™ time conversion service /erddap/convert/time.txt

...

Curl options passed on to crul::verb-GET

Details

When method = "web" time zone is GMT/UTC

Examples

Run this code
 if (FALSE) {
# local conversions
convert_time(n = 473472000)
convert_time(isoTime = "1985-01-02T00:00:00Z")

# using an ERDDAP™ web service
convert_time(n = 473472000, method = "web")
convert_time(isoTime = "1985-01-02T00:00:00Z", method = "web")
}

Run the code above in your browser using DataLab