How to Convert String Date to Timestamp in JEXL for Computed Attributes?

Lopsea month ago

I have an attribute called routeDetectionTime, which is a string in the format:
"2025-03-10 16:01:29"

I need to calculate the following logic in JEXL:

serverTime.getTime() - routeDetectionTime < 10000

However, since routeDetectionTime is a string, I need a way to convert it into a numeric timestamp.

Is there any way to parse a date string into a timestamp in JEXL?
If not, what would be the best approach to achieve this logic?

Anton Tananaeva month ago

Maybe you can do something like this:

serverTime.time - new('java.util.Date', routeDetectionTime).time < 10000