equal.html)
    * [ polars.testing.assert_frame_not_equal ](../../api/polars.testing.assert_frame_not_equal.html)
    * [ polars.testing.assert_series_equal ](../../api/polars.testing.assert_series_equal.html)
    * [ polars.testing.assert_series_not_equal ](../../api/polars.testing.assert_series_not_equal.html)
    * [ polars.testing.parametric.dataframes ](../../api/polars.testing.parametric.dataframes.html)
    * [ polars.testing.parametric.series ](../../api/polars.testing.parametric.series.html)
    * [ polars.testing.parametric.column ](../../api/polars.testing.parametric.column.html)
    * [ polars.testing.parametric.columns ](../../api/polars.testing.parametric.columns.html)
    * [ polars.testing.parametric.create_list_strategy ](../../api/polars.testing.parametric.create_list_strategy.html)
    * [ polars.testing.parametric.load_profile ](../../api/polars.testing.parametric.load_profile.html)
    * [ polars.testing.parametric.set_profile ](../../api/polars.testing.parametric.set_profile.html)

  * [ Metadata ](../../metadata.html) __
    * [ polars.build_info ](../../api/polars.build_info.html)
    * [ polars.get_index_type ](../../api/polars.get_index_type.html)
    * [ polars.show_versions ](../../api/polars.show_versions.html)
    * [ polars.thread_pool_size ](../../api/polars.thread_pool_size.html)
    * [ polars.threadpool_size ](../../api/polars.threadpool_size.html)

  * [ __ ](../../../index.html)
  * [ Python API reference ](../../index.html)
  * __
  * [ Temporal ](../temporal.html)
  * polars.Expr.... 

#  polars.Expr.dt.base_utc_offset  #

Expr.dt.  base_utc_offset  (  )  →  Expr  [ [source]
](https://github.com/pola-rs/polars/blob/main/py-
polars/polars/expr/datetime.py#L2319-L2356) #

    

Base offset from UTC.

This is usually constant for all datetimes in a given time zone, but may vary
in the rare case that a country switches time zone, like Samoa (Apia) did at
the end of 2011.

Returns  :

    

Expr

    

Expression of data type ` Duration  ` .

See also

[ ` Expr.dt.dst_offset  `
](polars.Expr.dt.dst_offset.html#polars.Expr.dt.dst_offset
"polars.Expr.dt.dst_offset")

    

Daylight savings offset from UTC.

Examples

    
    
    >>> from datetime import datetime
    >>> df = pl.DataFrame(
    ...     {
    ...         "ts": [datetime(2011, 12, 29), datetime(2012, 1, 1)],
    ...     }
    ... )
    >>> df = df.with_columns(pl.col("ts").dt.replace_time_zone("Pacific/Apia"))
    >>> df.with_columns(pl.col("ts").dt.base_utc_offset().alias("base_utc_offset"))
    shape: (2, 2)
    ┌────────────────────────────┬─────────────────┐
    │ ts                         ┆ base_utc_offset │
    │ ---                        ┆ ---             │
    │ datetime[μs, Pacific/Apia] ┆ duration[ms]    │
    ╞════════════════════════════╪═════════════════╡
    │ 2011-12-29 00:00:00 -10    ┆ -11h            │
    │ 2012-01-01 00:00:00 +14    ┆ 13h             │
    └────────────────────────────┴─────────────────┘
    

[ __ previous  polars.Expr.dt.add_business_days
](polars.Expr.dt.add_business_days.html "previous page") [ next
polars.Expr.dt.cast_time_unit  __ ](polars.Expr.dt.cast_time_unit.html "next
page")

__ On this page

  * ` Expr.dt.base_utc_offset()  `

© Copyright 2020, Ritchie Vink.  

Created using [ Sphinx ](https://www.sphinx-doc.org/) 7.2.4.  

Built with the [ PyData Sphinx Theme ](https://pydata-sphinx-
theme.readthedocs.io/en/stable/index.html) 0.14.1.