mirror of
https://github.com/openhab/openhab-addons.git
synced 2025-01-10 15:11:59 +01:00
adopted date parser due to changes in EASEE API (#13654)
Signed-off-by: Alexander Friese <af944580@googlemail.com>
This commit is contained in:
parent
1e07d1af03
commit
f880ca91f9
@ -56,7 +56,12 @@ public final class Utils {
|
||||
* @return
|
||||
*/
|
||||
public static ZonedDateTime parseDate(String date) throws DateTimeParseException {
|
||||
final DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ssX");
|
||||
DateTimeFormatter formatter;
|
||||
if (date.length() == 24) {
|
||||
formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ss.SSSX");
|
||||
} else {
|
||||
formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ssX");
|
||||
}
|
||||
LOGGER.trace("parsing: {}", date);
|
||||
ZonedDateTime zdt = ZonedDateTime.parse(date, formatter);
|
||||
return zdt;
|
||||
|
Loading…
Reference in New Issue
Block a user