diff --git a/kie-dmn/kie-dmn-feel/src/main/java/org/kie/dmn/feel/runtime/functions/TimeFunction.java b/kie-dmn/kie-dmn-feel/src/main/java/org/kie/dmn/feel/runtime/functions/TimeFunction.java index 82412d5574f..3cc2de7afb5 100644 --- a/kie-dmn/kie-dmn-feel/src/main/java/org/kie/dmn/feel/runtime/functions/TimeFunction.java +++ b/kie-dmn/kie-dmn-feel/src/main/java/org/kie/dmn/feel/runtime/functions/TimeFunction.java @@ -22,7 +22,6 @@ import java.math.RoundingMode; import java.time.DateTimeException; import java.time.Duration; -import java.time.LocalDateTime; import java.time.LocalTime; import java.time.OffsetTime; import java.time.ZoneId; diff --git a/kie-dmn/kie-dmn-feel/src/main/java/org/kie/dmn/feel/runtime/functions/extended/TimeFunction.java b/kie-dmn/kie-dmn-feel/src/main/java/org/kie/dmn/feel/runtime/functions/extended/TimeFunction.java index 6433dcdb836..67a650548dc 100644 --- a/kie-dmn/kie-dmn-feel/src/main/java/org/kie/dmn/feel/runtime/functions/extended/TimeFunction.java +++ b/kie-dmn/kie-dmn-feel/src/main/java/org/kie/dmn/feel/runtime/functions/extended/TimeFunction.java @@ -34,6 +34,7 @@ import java.time.temporal.TemporalQueries; import org.kie.dmn.api.feel.runtime.events.FEELEvent; +import org.kie.dmn.feel.runtime.custom.ZonedOffsetTime; import org.kie.dmn.feel.runtime.events.InvalidParametersEvent; import org.kie.dmn.feel.runtime.functions.BaseFEELFunction; import org.kie.dmn.feel.runtime.functions.BuiltInFunctions; @@ -81,6 +82,11 @@ public FEELFnResult invoke(@ParameterName("from") String val) // if it does not contain any zone information at all, then I know for certain is a local time. LocalTime asLocalTime = parsed.query(LocalTime::from); return FEELFnResult.ofResult(asLocalTime); + } else if (parsed.query(TemporalQueries.zone()) != null) { + LocalTime asLocalTime = parsed.query(LocalTime::from); + ZoneId zoneId = parsed.query(TemporalQueries.zone()); + ZonedOffsetTime zonedOffsetTime = ZonedOffsetTime.of(asLocalTime, zoneId); + return FEELFnResult.ofResult(zonedOffsetTime); } return FEELFnResult.ofResult(parsed);