getset_utc_offsets {datetimeoffset}R Documentation

Get/set UTC offset strings

Description

get_utc_offsets() and set_utc_offsets() gets/sets UTC offset strings

Usage

get_utc_offsets(x, sep = ":")

set_utc_offsets(x, value)

Arguments

x

A datetimeoffset() object

sep

Separator between hour and minute offsets. Either ":" or "".

value

Replace UTC offset string

Value

get_utc_offsets() returns a character string of UTC offset info. set_utc_offsets() returns a datetime (whose UTC offset info has been set).

See Also

get_hour_offset(), set_hour_offset(), get_minute_offset(), and set_minute_offset() allow getting/setting the separate individual hour/minute offset components with integers. fill_utc_offsets() fills any missing UTC offsets using non-missing time zones.

Examples

  dt <- as_datetimeoffset("2020-01-01T01:01")
  get_utc_offsets(dt)
  dt <- set_utc_offsets(dt, "-07:00")
  get_utc_offsets(dt)
  dt <- set_utc_offsets(dt, "+0800")
  get_utc_offsets(dt)
  dt <- set_utc_offsets(dt, "+00")
  get_utc_offsets(dt)
  dt <- set_utc_offsets(dt, NA_character_)
  get_utc_offsets(dt)

[Package datetimeoffset version 0.3.1 Index]