bigframes.pandas.api.typing.DatetimeMethods.tz_localize#
- DatetimeMethods.tz_localize(tz: Literal['UTC'] | None) Series[source]#
Localize tz-naive Datetime Array/Index to tz-aware Datetime Array/Index.
This method takes a time zone (tz) naive Datetime Array/Index object and makes this time zone aware. It does not move the time to another time zone. Only “UTC” timezone is supported.
This method can also be used to do the inverse - to create a time zone unaware object from an aware object. To that end, pass tz=None.
Examples:
>>> import bigframes.pandas as bpd >>> s = bpd.Series([pd.Timestamp(year = 2026, month=1, day=1)]) >>> s 0 2026-01-01 00:00:00 dtype: timestamp[us][pyarrow] >>> s.dt.tz_localize('UTC') 0 2026-01-01 00:00:00+00:00 dtype: timestamp[us, tz=UTC][pyarrow]
- Returns:
A BigFrames series with the updated timezone.