Learn R Programming

googleway (version 2.0.0)

google_timezone: Google timezone

Description

The Google Maps Time Zone API provides time offset data for locations on the surface of the earth. You request the time zone information for a specific latitude/longitude pair and date.

Usage

google_timezone(location, timestamp = Sys.time(), language = NULL,
  simplify = TRUE, key)

Arguments

location

vector of lat/lon pair

timestamp

POSIXct The Google Maps Time Zone API uses the timestamp to determine whether or not Daylight Savings should be applied. Will default to the current system time.

language

string specifies the language in which to return the results. See the list of supported languages: https://developers.google.com/maps/faq#using-google-maps-apis. If no langauge is supplied, the service will attempt to use the language of the domain from which the request was sent.

simplify

logical Indicates if the returned JSON should be coerced into a list

key

string A valid Google Developers Timezone API key.

Value

Either list or JSON string of the timezone

Examples

Run this code
# NOT RUN {
google_timezone(location = c(-37.81659, 144.9841),
               timestamp = as.POSIXct("2016-06-05"),
               key = "<your valid api key>")
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab