class_docstr: Namespace for datetime related expressions.
docstr: Convert a Date/Time/Datetime column into a String column with the given format.
  
  Similar to `cast(pl.String)`, but this method allows you to customize the
  formatting of the resulting string.
  
  Parameters
  ----------
  format
      Format to use, refer to the `chrono strftime documentation
      <https://docs.rs/chrono/latest/chrono/format/strftime/index.html>`_
      for specification. Example: `"%y-%m-%d"`.
  
  Examples
  --------
  >>> from datetime import datetime
  >>> df = pl.DataFrame(
  ...     {
  ...         "datetime": [
  ...             datetime(2020, 3, 1),
  ...             datetime(2020, 4, 1),
  ...             datetime(2020, 5, 1),
  ...         ]
  ...     }
  ... )
  >>> df.with_columns(
  ...     pl.col("datetime")
  ...     .dt.to_string("%Y/%m/%d %H:%M:%S")
  ...     .alias("datetime_string")
  ... )
  shape: (3, 2)
  ┌─────────────────────┬─────────────────────┐
  │ datetime            ┆ datetime_string     │
  │ ---                 ┆ ---                 │
  │ datetime[μs]        ┆ str                 │
  ╞═════════════════════╪═════════════════════╡
  │ 2020-03-01 00:00:00 ┆ 2020/03/01 00:00:00 │
  │ 2020-04-01 00:00:00 ┆ 2020/04/01 00:00:00 │
  │ 2020-05-01 00:00:00 ┆ 2020/05/01 00:00:00 │
  └─────────────────────┴─────────────────────┘
docstr_tok: ["Convert","a","Date\/Time\/Datetime","column","into","a","String","column","with","the","given","format",".","Similar","to","`","cast","(","pl.String",")","`",",","but","this","method","allows","you","to","customize","the","formatting","of","the","resulting","string",".","Parameters","--","--","--","--","--","format","Format","to","use",",","refer","to","the","`","chrono","strftime","documentation","<","https",":","\/\/docs.rs\/chrono\/latest\/chrono\/format\/strftime\/index.html",">","`","_","for","specification",".","Example",":","`","``","%","y-","%","m-","%","d","''","`",".","Examples","--","--","--","--",">",">",">","from","datetime","import","datetime",">",">",">","df","=","pl.DataFrame","(","...","{","...","``","datetime","''",":","[","...","datetime","(","2020",",","3",",","1",")",",","...","datetime","(","2020",",","4",",","1",")",",","...","datetime","(","2020",",","5",",","1",")",",","...","]","...","}","...",")",">",">",">","df.with_columns","(","...","pl.col","(","``","datetime","''",")","...",".dt.to_string","(","``","%","Y\/","%","m\/","%","d","%","H",":","%","M",":","%","S","''",")","...",".alias","(","``","datetime_string","''",")","...",")","shape",":","(","3",",","2",")","\u250c\u2500\u2500\u2500\u2500\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\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510","\u2502","datetime","\u2506","datetime_string","\u2502","\u2502","--","-","\u2506","--","-","\u2502","\u2502","datetime","[","\u03bcs","]","\u2506","str","\u2502","\u255e\u2550\u2550\u2550\u2550\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\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2561","\u2502","2020-03-01","00:00:00","\u2506","2020\/03\/01","00:00:00","\u2502","\u2502","2020-04-01","00:00:00","\u2506","2020\/04\/01","00:00:00","\u2502","\u2502","2020-05-01","00:00:00","\u2506","2020\/05\/01","00:00:00","\u2502","\u2514\u2500\u2500\u2500\u2500\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\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518"]
code: def to_string(self, format: str) -> Expr:
      """
      Convert a Date/Time/Datetime column into a String column with the given format.
  
      Similar to `cast(pl.String)`, but this method allows you to customize the
      formatting of the resulting string.
  
      Parameters
      ----------
      format
          Format to use, refer to the `chrono strftime documentation
          <https://docs.rs/chrono/latest/chrono/format/strftime/index.html>`_
          for specification. Example: `"%y-%m-%d"`.
  
      Examples
      --------
      >>> from datetime import datetime
      >>> df = pl.DataFrame(
      ...     {
      ...         "datetime": [
      ...             datetime(2020, 3, 1),
      ...             datetime(2020, 4, 1),
      ...             datetime(2020, 5, 1),
      ...         ]
      ...     }
      ... )
      >>> df.with_columns(
      ...     pl.col("datetime")
      ...     .dt.to_string("%Y/%m/%d %H:%M:%S")
      ...     .alias("datetime_string")
      ... )
      shape: (3, 2)
      ┌─────────────────────┬─────────────────────┐
      │ datetime            ┆ datetime_string     │
      │ ---                 ┆ ---                 │
      │ datetime[μs]        ┆ str                 │
      ╞═════════════════════╪═════════════════════╡
      │ 2020-03-01 00:00:00 ┆ 2020/03/01 00:00:00 │
      │ 2020-04-01 00:00:00 ┆ 2020/04/01 00:00:00 │
      │ 2020-05-01 00:00:00 ┆ 2020/05/01 00:00:00 │
      └─────────────────────┴─────────────────────┘
  
      """
      return wrap_expr(self._pyexpr.dt_to_string(format))
  
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 5 for calling the ExprDateTimeNameSpace obj's underlying member method code with example usage: obj.to_string(format) and returns: wrap_expr