Signed-Off-By: Karel Goderis <karel.goderis@me.com>
This commit is contained in:
Karel Goderis 2022-06-23 18:52:31 +02:00 committed by GitHub
parent df06cd3af3
commit 22304b3fd0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 1 deletions

View File

@ -95,6 +95,7 @@ public class KNXCoreTypeMapper implements KNXTypeMapper {
private final Logger logger = LoggerFactory.getLogger(KNXCoreTypeMapper.class);
private static final String TIME_DAY_FORMAT = new String("EEE, HH:mm:ss");
private static final String TIME_FORMAT = new String("HH:mm:ss");
private static final String DATE_FORMAT = new String("yyyy-MM-dd");
/**
@ -1085,7 +1086,11 @@ public class KNXCoreTypeMapper implements KNXTypeMapper {
stb.replace(start, end, String.format(Locale.US, "%1$ta", Calendar.getInstance()));
value = stb.toString();
}
try {
date = new SimpleDateFormat(TIME_DAY_FORMAT, Locale.US).parse(value);
} catch (ParseException pe) {
date = new SimpleDateFormat(TIME_FORMAT, Locale.US).parse(value);
}
}
} catch (ParseException pe) {
// do nothing but logging