GMToffset: Finds offset in hours from UTC for given time zone.

GMToffsetR Documentation

Finds offset in hours from UTC for given time zone.

Description

Finds offset in hours from UTC for given time zone.

Usage

GMToffset(timezone)

Arguments

timezone

Required. A string containing the time zone. Works with designated time zones such as CST and MST for Central Standard or Mountain Standard time or offset time zones such as etc/GMT+6 or etc/GMT+7 for Central Standard and Mountain Standard time. Does NOT work with location time zones like America/Regina.

Value

Returns the offset in hours as a numeric value.

Note

This code was based on the function GMTOffsetFromTz in the package oce, but works for more time zones and returns a negative value in the western hemisphere.

Author(s)

Kevin Shook

Examples

GMToffset('MST')
GMToffset('etc/GMT+6')

CentreForHydrology/CRHMr documentation built on April 6, 2024, 5:27 p.m.