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

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

Description

Convert an U.S. Geological Survey National Water Information System (NWIS) (U.S. Geological Survey, 2019) time-zone code to the offset in hours from Coordinated Universal Time (UTC). 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

tz

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;

Value

The UTC offsets in hours. 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

utc2nwislocal, utc_offset_hours2nwislocal,
nwislocal2utc_offset_seconds

Examples

1
2
3
4
5
nwislocal2utc_offset_hours(c("PST","PDT","the author",NA,"CDT"))
# Results, in hours, are: [1] -8 -7 NA  0 -5

# Force inspection of lookup table contents, using triple colon notation:
ls(utc2nwislocal:::.NWIStzUTC$TimeZone_Offset) # keys are time-zone codes

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