tz_offset: Get timezone offset

tz_offsetR Documentation

Get timezone offset

Description

Returns the UTC offset for a given datetime in its specified timezone.

Usage

tz_offset(x, ...)

Arguments

x

A time class coercible to POSIXt with an associated time zone.

...

Additional arguments passed to methods.

Value

A mixtime duration vector of offsets from UTC in the same chronon (e.g. seconds for POSIXt, days for dates, etc.)

Examples

tz_offset(as.POSIXct(Sys.time(), tz = Sys.timezone()))
tz_offset(as.POSIXct("2024-06-15 12:00:00", tz = "America/New_York"))

mixtime documentation built on Nov. 18, 2026, 5:08 p.m.