Skip to content

featurebyte.Feature.dt.tz_offset

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

Returns

  • DatetimeAccessor

Examples

>>> feature = catalog.get_feature("CustomerLatestInvoiceTimestamp")
>>> feature_group = fb.FeatureGroup([feature])
>>> feature_group["TimestampWithOffset"] = feature.dt.tz_offset("+08:00").hour