-
Bug
-
Resolution: Duplicate
-
Major
-
None
-
9.0.1.Final
-
None
The "org.jboss.logmanager.handlers.SyslogHandler" is adding a leading zero to the October month as it's concatenating '0' whenever the month value is below 10. However, the month number is zero based (January = 0). The outcome is an invalid ISO8601 timestamp as the month part will be '010' instead of '10'.
Calendar cal = Calendar.getInstance();
cal.setTimeInMillis(millis);
int month = cal.get(2);
int day = cal.get(5);
int hours = cal.get(11);
int minutes = cal.get(12);
int seconds = cal.get(13);
buffer.append(cal.get(1)).append('-');
if (month < 10) {
buffer.append(0);
buffer.append(month + 1).append('-');