pandas.Timestamp.strftime#
- Timestamp.strftime(format)#
返回一个字符串,该字符串表示由显式格式字符串控制的给定POSIX时间戳。
- 参数
- format应力
格式化字符串以将时间戳转换为字符串。有关格式字符串:https://docs.python.org/3/library/datetime.html#strftime-and-strptime-behavior.的更多信息,请参阅StrfTime文档
示例
>>> ts = pd.Timestamp('2020-03-14T15:32:52.192548651') >>> ts.strftime('%Y-%m-%d %X') '2020-03-14 15:32:52'