find_utc_offset: Finds the UTC offset in a date-time string

View source: R/time_dimensions.R

find_utc_offsetR Documentation

Finds the UTC offset in a date-time string

Description

Finds the UTC offset in a date-time or time axis specification string such as 'hours since 2015-10-04 00:00:00 +1030'

Usage

find_utc_offset(time_units, as_string = TRUE)

Arguments

time_units

the string to process

as_string

a boolean. If true, return the time offset as a character, otherwise return a difftime object.

Value

the time offset as a character, or as a difftime object.

Examples


x <- "hours since 2015-10-04 00:00:00 +1023"
find_utc_offset(x)
find_utc_offset(x, FALSE)
x <- "hours since 2015-10-04 00:00:00 -0837"
find_utc_offset(x)
find_utc_offset(x, FALSE)    
x <- "hours since 2015-10-04 00:00:00"
find_utc_offset(x)
find_utc_offset(x, FALSE)


jmp75/efts documentation built on Feb. 3, 2023, 2:44 p.m.