SQLAlchemy中时间格式化及将时间戳转成对应时间的方法-mysql

时间:2023-03-09 02:53:56
SQLAlchemy中时间格式化及将时间戳转成对应时间的方法-mysql

https://blog.****.net/guoqianqian5812/article/details/80175866

方法很简答,都是借助于mysql数据库提供的函数
将时间格式化方法

func.date_format(Table.create_time, "%Y-%m-%d %H:%i:%s")

1

将时间戳转化成时间

func.from_unixtime((Table.timestamp), "%Y-%m-%d %H:%i:%s")
---------------------  
作者:guoqianqian5812  
来源:****  
原文:https://blog.****.net/guoqianqian5812/article/details/80175866  
版权声明:本文为博主原创文章,转载请附上博文链接!