pyufunc.fmt_dt_to_str#
- pyufunc.fmt_dt_to_str(dt='', dt_fmt='')#
Format datetime to datetime string.
- Parameters:
See also
pyufunc.__cfg.config_datetime_fmt : pre-defined datetime string formats
- Returns:
the formatted datetime string
- Return type:
Example
>>> from pyufunc import fmt_dt_to_str >>> fmt_dt_to_str() '2024-02-06' >>> fmt_dt_to_str(dt_fmt="%Y/%m/%d %H:%M:%S") '2024/02/06 00:00:00' >>> fmt_dt_to_str("2024-02-06", dt_fmt="%Y/%m/%d") '2024/02/06' >>> fmt_dt_to_str("2024-02-06", dt_fmt="%Y/%m/%d %H:%M:%S") '2024/02/06 00:00:00' >>> fmt_dt_to_str(datetime.datetime.now(), "%Y/%m/%d %H:%M:%S") '2024/02/06 11:11:11'