Skip to content

featurebyte.Target.dt.tz_offset

tz_offset(
timezone_offset: Union[str, Target]
) -> DatetimeAccessor

Description

Returns a DatetimeAccessor object with the specified timezone offset. The timezone offset will be applied to convert the underlying timestamp column to localized time before extracting datetime properties.

Parameters

  • timezone_offset: Union[str, Target]
    The timezone offset to apply. If a string is provided, it must be a valid timezone offset in the format "(+|-)HH:mm". If the timezone offset can also be a column in the table, in which case a Target object should be provided.

Returns

  • DatetimeAccessor

Examples

>>> target = catalog.get_target("target_latest_invoice_timestamp")
>>> target_tz_with_offset = target.dt.tz_offset("+08:00").hour