timeIn: Fetch the current time in a specific city

timeInR Documentation

Fetch the current time in a specific city

Description

Get the current time using specified city name

Usage

timeIn

Format

An object of class list of length 2226.

Value

a list containing all cities and corresponding local time

Examples

# view the searchable cities, return first 10
names(timeIn)[1:10]

#task 0: check if the time in Delhi is present
#should be all in lower case
grep("delhi",names(timeIn), value = TRUE)

#task 1: check the time in delhi
timeIn$`india, delhi, new delhi`

#task 2: check the time in Boston
timeIn$`usa, massachusetts, boston`

#task 3: view the time in multiple countries
timeIn[c(
"china, zhejiang, hangzhou",
"nigeria, kano, kano",
"usa, texas, garland"
)]

#task 4: what if the city is not available
timeIn[c("randomcity","york","jerusalem")]


r2country documentation built on Sept. 11, 2024, 9:24 p.m.