ngbatis
ngbatis copied to clipboard
class 'ResultSetUtil.java' parse datetime type error
Time transfer error. The internal time of the datetimeWrapper is UTC time. If the time zone is East Eighth Zone, it will be eight hours less
private static Object transformDateTime(DateTimeWrapper dateTime) {
// change here, maybe use localdateTime instead ?
DateTime localDateTime = dateTime.getLocalDateTime();
try {
CALENDAR_CONSTRUCTOR.setAccessible(true);
GregorianCalendar calendar = CALENDAR_CONSTRUCTOR.newInstance(
localDateTime .getYear(),
localDateTime .getMonth() - 1,
localDateTime .getDay(),
localDateTime .getHour(),
localDateTime .getMinute(),
localDateTime .getSecond(),
Math.floorDiv(localDateTime .getMicrosec(), 1000)
);
CALENDAR_CONSTRUCTOR.setAccessible(false);
return calendar.getTime();
} catch (Exception e) {
return new GregorianCalendar(
localDateTime .getYear(),
localDateTime .getMonth() - 1,
localDateTime .getDay(),
localDateTime .getHour(),
localDateTime .getMinute(),
localDateTime .getSecond()
).getTime();
}
}
Hi, @bobobod Sorry, I lost the timezoneOffset before. Looking forward to your PR ~
Recently, there is a Hacktoberfest activity, and I ask if the bug-fixed PR could participate in the activity.
cc: @wey-gu
got it
I think so, too!
Hi, @bobobod Sorry, I lost the timezoneOffset before. Looking forward to your PR ~
Recently, there is a Hacktoberfest activity, and I ask if the bug-fixed PR could participate in the activity.
cc: @wey-gu
is this issue still available?