背景:
企业开发中遇到的问题场景解决【随时间逐步添加场景问题】
具体场景:
场景1:对一个列表[里面元素是秒级时间戳],原始数据无序,需要进行有序排列,对列表进行排序【默认由大到小】,使用sorted内置函数
- reverse -- 排序规则,reverse = True 降序 , reverse = False 升序(默认)。
- 更多参数见Python sorted() 函数 | 菜鸟教程 (runoob.com)
list_one = [1697187073, 1697504643, 1697439883, 1697187023, 1697505015, 1697186842]
print(list_one)
# [1697187073, 1697504643, 1697439883, 1697187023, 1697505015, 1697186842]
list_one = sorted(list_one,reverse=True)
print(list_one)
# [1697505015, 1697504643, 1697439883, 1697187073, 1697187023, 1697186842]
list_one = sorted(list_one,reverse=False)
print(list_one)
# [1697186842, 1697187023, 1697187073, 1697439883, 1697504643, 1697505015]


场景2:将秒级时间戳转为年月日时分秒形式【等待添加】



![2023年全球及中国CGT CDMO市场发展现状分析:CGT 渗透率有效助力CGT CDMO快速发展[图]](https://img-blog.csdnimg.cn/img_convert/bc870504b0f312da31c02f768ec8f883.png)















