Strange behavior on return timestamp

Hi Community!

I’m bothered you with this post because i get a strange behavior using minimunSince and maximuSince in a rule.

Just for info OH 2.5.10 running on Qnap NAS .

I have a pressur sensor and i need to show the minimun and maximum value using the following rule:

rule "min max Pressure con data"
when
        Item iWS_Pressure changed 
	or Time cron "0 0 0 * * ?"
	or System started 
	//or Time cron "0/5 * * * * ?"

then
	var minpres = iWS_Pressure.minimumSince(now.withTimeAtStartOfDay)
        var datapres_e =(minpres.state as DecimalType).format("%.1f") + " hPa (" + (minpres.timestamp) + ")"
       	logInfo("WS.rules:" , "Pres Min = " + datapres_e)

        var datapres_f = transform("REGEX","(.*\\d*.\\d*.\\w*\\s...)\\s.\\d*-\\d*-\\d*\\s\\d*:\\d*:\\d*.\\d*..*", datapres_e) 
	var datapres_g =(minpres.state as DecimalType).format("%.1f") + " hPa (" + (minpres.timestamp) + ")"
	var datapres_h = transform("REGEX",".*\\d*.\\d*.\\w*\\s...\\s.\\d*-\\d*-\\d*\\s(\\d*:\\d*):\\d*.\\d*.", datapres_g)
	var datapres_totmin = datapres_f +" alle ore " + datapres_h   
	logInfo("WS.rules:" , "Pressione WS Min = " + datapres_totmin)
	postUpdate(iWS_Pressure_Min, datapres_totmin)

	var maxpres = iWS_Pressure.maximumSince(now.withTimeAtStartOfDay)
        var datapres_a =(maxpres.state as DecimalType).format("%.1f") + " hPa (" + (maxpres.timestamp) + ")"
       	logInfo("WS.rules:" , "Pres Max = " + datapres_a)

        var datapres_b = transform("REGEX","(\\d*.\\d*.\\w*\\s...)\\s.\\d*-\\d*-\\d*\\s\\d*:\\d*:\\d*.\\d*.", datapres_a)   
	var datapres_c =(maxpres.state as DecimalType).format("%.1f") + " hPa (" + (maxpres.timestamp) + ")"
	var datapres_d = transform("REGEX",".*\\d*.\\d*.\\w*\\s...\\s.\\d*-\\d*-\\d*\\s(\\d*:\\d*):\\d*.\\d*.", datapres_c)
	var datapres_totmax = datapres_b +" alle ore " + datapres_d   
	logInfo("WS.rules:" , "Pressione WS Max = " + datapres_totmax)
	postUpdate(iWS_Pressure_Max, datapres_totmax)


end

everithing works fine except when the readed value corrisponding at the minimum or maximun value, in fact, in that case, the return string change the date formatting.

let me be more clear:
in this few lines of log the value minpres of the above rule is in the range between min and max and you can see that it returs the date format as (YYYY-MM-DD HH:MM:SS.0) and the system return the right REGEX trasformation

05-Mar-2021 00:01:06.812 [INFO ] [org.eclipse.smarthome.model.script.WS.rules:      ] - Pres Min = 1015.0 hPa (2021-03-05 00:00:56.0)
05-Mar-2021 00:01:06.812 [INFO ] [org.eclipse.smarthome.model.script.WS.rules:      ] - Pressione WS Min = 1015.0 hPa alle ore 00:00

if you look this other few lines of log, the value store in minipress is the minimun value within the day and in this case i get the date format as (Day of the Week, Month, Day, HH:MM:SS CET Year)

05-Mar-2021 00:00:16.799 [INFO ] [org.eclipse.smarthome.model.script.WS.rules:      ] - Pres Min = 1015.1 hPa (Fri Mar 05 00:00:16 CET 2021)
05-Mar-2021 00:00:16.801 [INFO ] [org.eclipse.smarthome.model.script.WS.rules:      ] - Pressione WS Min = null alle ore null

of course in this second case no chance to have the REGEX working and i get a displayed null value.

I know you may object as the rule is done, in fact i’m sure its not a state of art, but it really drive me nuts this behavior i dont know how to solve.

Thanks for any help.
Costa