Timestamp to sensor in rules

I'm trying to display on my gui a timestamp when was the last time a certain rule was fired. So in the rule i want to push a timestamp to a status command linked to a custom sensor which is visible in the gui.
But what would be the best way to mak e this timestamp? If possible i d like to avoid using a shell script.
My initial idea was to use a sensor which has a status cmd of the date time protocol. And then using that sensor value. Here is my rule in which i try to store the timestamp. But it outputs literally the name of the sensor.

rule "alarm aanwezig inschakelen"
when
  $evt:Event(source == "virtual_sensor_aanw", value == "1")
then
  execute.command("groep alles uit gelijk (OFF)");
  execute.command("Sonos Woonkamer pause");
//1 lijn test test
  execute.command("virtual_time_afw","Snsr_Display_ Date_Time");
end

There is even a simpler way to see a timestamp:

import java.text.SimpleDateFormat;

import java.util.Date;

function String _TimeStamp(){

Date now = new Date();

SimpleDateFormat dateFormatter = new SimpleDateFormat(“HH:mm:ss”);

return(dateFormatter.format(now));

}

rule “alarm aanwezig inschakelen”
when
$evt:Event(source == “virtual_sensor_aanw”, value == “1”)
then
execute.command(“groep alles uit gelijk (OFF)”);
execute.command(“Sonos Woonkamer pause”);
//1 lijn test test
execute.command(“virtual_time_afw”, _TimeStamp() );
end

``

Thanks Michal! that did it!