class_docstr: Namespace for datetime related expressions.
docstr: Get the time passed since the Unix EPOCH in the give time unit.
  
  Parameters
  ----------
  time_unit : {'ns', 'us', 'ms', 's', 'd'}
      Time unit.
  
  Examples
  --------
  >>> from datetime import date
  >>> df = (
  ...     pl.date_range(date(2001, 1, 1), date(2001, 1, 3), eager=True)
  ...     .alias("date")
  ...     .to_frame()
  ... )
  >>> df.with_columns(
  ...     pl.col("date").dt.epoch().alias("epoch_ns"),
  ...     pl.col("date").dt.epoch(time_unit="s").alias("epoch_s"),
  ... )
  shape: (3, 3)
  ┌────────────┬─────────────────┬───────────┐
  │ date       ┆ epoch_ns        ┆ epoch_s   │
  │ ---        ┆ ---             ┆ ---       │
  │ date       ┆ i64             ┆ i64       │
  ╞════════════╪═════════════════╪═══════════╡
  │ 2001-01-01 ┆ 978307200000000 ┆ 978307200 │
  │ 2001-01-02 ┆ 978393600000000 ┆ 978393600 │
  │ 2001-01-03 ┆ 978480000000000 ┆ 978480000 │
  └────────────┴─────────────────┴───────────┘
docstr_tok: ["Get","the","time","passed","since","the","Unix","EPOCH","in","the","give","time","unit",".","Parameters","--","--","--","--","--","time_unit",":","{","'ns","'",",","'us","'",",","'ms","'",",","'s","'",",","'d","'","}","Time","unit",".","Examples","--","--","--","--",">",">",">","from","datetime","import","date",">",">",">","df","=","(","...","pl.date_range","(","date","(","2001",",","1",",","1",")",",","date","(","2001",",","1",",","3",")",",","eager=True",")","...",".alias","(","``","date","''",")","...",".to_frame","(",")","...",")",">",">",">","df.with_columns","(","...","pl.col","(","``","date","''",")",".dt.epoch","(",")",".alias","(","``","epoch_ns","''",")",",","...","pl.col","(","``","date","''",")",".dt.epoch","(","time_unit=","''","s","''",")",".alias","(","``","epoch_s","''",")",",","...",")","shape",":","(","3",",","3",")","\u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510","\u2502","date","\u2506","epoch_ns","\u2506","epoch_s","\u2502","\u2502","--","-","\u2506","--","-","\u2506","--","-","\u2502","\u2502","date","\u2506","i64","\u2506","i64","\u2502","\u255e\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u256a\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u256a\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2561","\u2502","2001-01-01","\u2506","978307200000000","\u2506","978307200","\u2502","\u2502","2001-01-02","\u2506","978393600000000","\u2506","978393600","\u2502","\u2502","2001-01-03","\u2506","978480000000000","\u2506","978480000","\u2502","\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518"]
code: def epoch(self, time_unit: EpochTimeUnit = "us") -> Expr:
      """
      Get the time passed since the Unix EPOCH in the give time unit.
  
      Parameters
      ----------
      time_unit : {'ns', 'us', 'ms', 's', 'd'}
          Time unit.
  
      Examples
      --------
      >>> from datetime import date
      >>> df = (
      ...     pl.date_range(date(2001, 1, 1), date(2001, 1, 3), eager=True)
      ...     .alias("date")
      ...     .to_frame()
      ... )
      >>> df.with_columns(
      ...     pl.col("date").dt.epoch().alias("epoch_ns"),
      ...     pl.col("date").dt.epoch(time_unit="s").alias("epoch_s"),
      ... )
      shape: (3, 3)
      ┌────────────┬─────────────────┬───────────┐
      │ date       ┆ epoch_ns        ┆ epoch_s   │
      │ ---        ┆ ---             ┆ ---       │
      │ date       ┆ i64             ┆ i64       │
      ╞════════════╪═════════════════╪═══════════╡
      │ 2001-01-01 ┆ 978307200000000 ┆ 978307200 │
      │ 2001-01-02 ┆ 978393600000000 ┆ 978393600 │
      │ 2001-01-03 ┆ 978480000000000 ┆ 978480000 │
      └────────────┴─────────────────┴───────────┘
  
      """
      if time_unit in DTYPE_TEMPORAL_UNITS:
          return self.timestamp(time_unit)  # type: ignore[arg-type]
      elif time_unit == "s":
          return wrap_expr(self._pyexpr.dt_epoch_seconds())
      elif time_unit == "d":
          return wrap_expr(self._pyexpr).cast(Date).cast(Int32)
      else:
          raise ValueError(
              f"`time_unit` must be one of {{'ns', 'us', 'ms', 's', 'd'}}, got {time_unit!r}"
          )
  
imports: from __future__ import annotations
  import datetime
  from typing import TYPE_CHECKING
  import polars._reexport
  from polars import functions
  from polars.datatypes import DTYPE_TEMPORAL_UNITS, Date, Int32
  from polars.utils._parse_expr_input import parse_as_expression
  from polars.utils._wrap import wrap_expr
  from polars.utils.convert import _timedelta_to_pl_duration
  from polars.utils.deprecation import deprecate_renamed_function, deprecate_saturating, issue_deprecation_warning, rename_use_earliest_to_ambiguous
label_desc: Use image node_id 25 for calling the ExprDateTimeNameSpace obj's underlying member method code with example usage: obj.epoch(time_unit) and returns: self, wrap_expr, wrap_expr