pandas / 1.4.0 / reference / api / pandas.timestamp.strftime.html /

pandas.Timestamp.strftime

Timestamp. strftime ( format )

Return a string representing the given POSIX timestamp controlled by an explicit format string.

Parameters
format :str

Format string to convert Timestamp to string. See strftime documentation for more information on the format string: https://docs.python.org/3/library/datetime.html#strftime-and-strptime-behavior.

Examples

>>> ts = pd.Timestamp('2020-03-14T15:32:52.192548651')
>>> ts.strftime('%Y-%m-%d %X')
'2020-03-14 15:32:52'

© 2008–2022, AQR Capital Management, LLC, Lambda Foundry, Inc. and PyData Development Team
Licensed under the 3-clause BSD License.
https://pandas.pydata.org/pandas-docs/version/1.4.0/reference/api/pandas.Timestamp.strftime.html