我有以下词典列表:
my_list = [
{
"field1": value,
"field2": value,
"time": 2017-12-01 14:34:12,
"field3": value
},
{
"field1": value,
"field2": value,
"time": 2017-12-01 14:31:20,
"field3": value
},
{
"field1": value,
"field2": value,
"time": 2017-12-01 14:40:02,
"field3": value
}
]
如何按字典的time
值对此列表进行排序?
(因此具有最高time
值的字典将位于列表的第一个索引中,依此类推..)
谢谢!