utc_offset_hours2nwislocal: Convert a Offset in Hours from UTC to NWIS Local Time Zone

Description Usage Arguments Value Author(s) References See Also Examples

Description

Convert an offset in hours from Coordinated Universal Time (UTC) to a U.S. Geological Survey National Water Information System (NWIS) (U.S. Geological Survey, 2019) time-zone code. The NWIS time-zone codes can be found at NWIS Time Zones (accessed on October 22, 2019) and see file ./inst/doc/README.md in the utc2nwislocal sources for more details.

Usage

1

Arguments

hrs

A vector of NWIS time-zone codes (such as lev_tz_cd), and NA values are assumed to be in UTC with offset of zero;

split

A logical triggering a unlist(strsplit()) on the time-zone codes (see Examples); and

trace

A logical triggering a message() where the user can see the looping through the time-zone codes.

Value

One or more time-zone codes matching the hrs (if any) as affected by the split argument. The string " and " is inserted between the time-zone codes if split=FALSE; otherwise, a vector of the time-zone-codes results. Any time zone that does not exist in the lookup table (the hidden environment [hash table] .NWIStzUTC$TimeZone_Offset), is set to NA (see Examples).

Author(s)

W.H. Asquith

References

U.S. Geological Survey, 2019, USGS water data for the Nation: U.S. Geological Survey National Water Information System database, accessed August 9, 2019, at https://doi.org/10.5066/F7P55KJN.

See Also

nwislocal2utc_offset_hours

Examples

1
2
3
4
5
6
7
8
utc_offset_hours2nwislocal("+02:00", split=FALSE)
# [1] "CETDST and EET and FWT and IST and MEST and METDST and SST"

utc_offset_hours2nwislocal("+02:00", split=TRUE)
# [1] "CETDST" "EET"    "FWT"    "IST"    "MEST"   "METDST" "SST"

utc_offset_hours2nwislocal( "+2:00", split=FALSE) # must have proper syntax
# [1] NA

wasquith-usgs/utc2nwislocal documentation built on Oct. 24, 2020, 4:29 p.m.