如何转换以下日期时间格式

时间:2018-08-31 07:50:57

标签: python-3.x datetime

我必须将1/1/2016 0:00转换为2016-01-01 00:00:00

当前使用的方法:

datetime.strptime((1/1/2016 0:00, "%m %d %Y %I:%M")

错误:

ValueError: time data '1/1/2016 0:00' does not match format '%m %d %Y %I:%M'

1 个答案:

答案 0 :(得分:0)

在Python 3.6中,您可以这样做:

std::stable_sort(vec.begin(), vec.end(),
                 [](const auto& a, const auto& b){return a.first < b.first;});
相关问题