datetime.datetime(2022, 1, 6, 0, 0),从数据库去出这样的数据,要怎么转换啊‘
试试
datetime.datetime.strftime(dt,"%Y-%m-%d )
看能不能转如果不行, 那要考虑数据库里读数据时就把datetime 转成字符型。