我不断得到这些结果:
Comparator<SelectItem> comparator = new Comparator<SelectItem>() {
@Override
public int compare(SelectItem o1, SelectItem o2) {
return Integer.compare(Integer.parseInt(o1.getLabel()), Integer.parseInt(o2.getLabel()));
}
};
但是,我的目标是获得以下结果:
0 2019-02-28 19:24:18.101586+00:00
1 2019-03-01 08:33:15.668978+00:00
[...]
Name: created, dtype: datetime64[ns, UTC]
您看到我在做什么吗?
0 2019-02-28
1 2019-03-01
答案 0 :(得分:1)
如果需要无时间限制的日期时间,请将Series.dt.tz_localize
与Series.dt.floor
配合使用:
tickets['created'] = tickets['created'].dt.tz_localize(None).dt.floor('d')
print (tickets)
created
0 2019-02-28
1 2019-03-01
print (tickets.dtypes)
created datetime64[ns]
dtype: object