您好,在下面的代码中想要从 LocalDateTime 中删除 T 和 Zone 。
任何人都可以帮我解决这个问题。
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.O) {
LocalDateTime time = LocalDateTime.now();
firstDayOfQuarteropp = time.with(time.getMonth().firstMonthOfQuarter())
.with(TemporalAdjusters.firstDayOfMonth());
Log.d("firstDayOfQuarteropp", String.valueOf(firstDayOfQuarteropp));
lastDayOfQuarteropp = firstDayOfQuarteropp.plusMonths(2)
.with(TemporalAdjusters.lastDayOfMonth());
Log.d("lastDayOfQuarteropp", String.valueOf(lastDayOfQuarteropp));
}
实际输出:
2020-04-01T11:54:05.514
预期输出:
2020-04-01 11:54:05