cudf.core.series.DatetimeProperties.strftime#

DatetimeProperties.strftime(date_format, *args, **kwargs)#

Convert to Series using specified date_format.

Return a Series of formatted strings specified by date_format, which supports the same string format as the python standard library. Details of the string format can be found in python string format doc.

Parameters
date_formatstr

Date format string (e.g. “%Y-%m-%d”).

Returns
Series

Series of formatted strings.

Notes

The following date format identifiers are not yet supported: %c, %x,``%X``

Examples

>>> import cudf
>>> import pandas as pd
>>> weekday_series = cudf.Series(pd.date_range("2000-01-01", periods=3,
...      freq="q"))
>>> weekday_series.dt.strftime("%Y-%m-%d")
>>> weekday_series
0   2000-03-31
1   2000-06-30
2   2000-09-30
dtype: datetime64[ns]
0    2000-03-31
1    2000-06-30
2    2000-09-30
dtype: object
>>> weekday_series.dt.strftime("%Y %d %m")
0    2000 31 03
1    2000 30 06
2    2000 30 09
dtype: object
>>> weekday_series.dt.strftime("%Y / %d / %m")
0    2000 / 31 / 03
1    2000 / 30 / 06
2    2000 / 30 / 09
dtype: object