【发布时间】:2019-02-10 02:33:16
【问题描述】:
这些代码:
String genType = FileConstants.CHANGE_CYCLE;
ResultTable[] genericCode = RTManager.getRTCsmGenericCodesDecodeList(genType);
String genCode = Arrays.toString(genericCode);
返回这些值:
genCode = [[code=22:00:00]
[dCode=Cut-off time for change bill_cycle if existing cycle_close_date=activity_date]]
问题:如何只获取'22:00:00' 并将其转换为Time datatype?
【问题讨论】:
-
第一步是避免使用
Arrays.toString,而是使用genericCode[0].toString()。请告诉我们返回的内容,以便我们在下一步为您提供最佳帮助。 -
是什么让您认为您想要
Time类型的结果?该课程早已过时,而且设计总是很糟糕。使用来自java.time, the modern Java date and time API 的LocalTime可能会更好。