Skip to content

featurebyte.ViewColumn.dt.tz_offset

tz_offset(
timezone_offset: Union[str, FrozenSeries]
) -> 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, FrozenSeries]
    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 Column object should be provided.

Returns

  • DatetimeAccessor

Examples

>>> view = catalog.get_view("GROCERYINVOICE")
>>> view["TimestampYearWithOffset"] = view["Timestamp"].dt.tz_offset("+08:00").year