Getting the timestamp of a Tag using scripting

Hello, everyone...
I'm trying to get the timestamp of a boolean tag every time it has been set to 1 in a defined period of time. I want to do that through scripting, any ideas?

Gateway Tag Change Script

Thanks Robert

Or just a tag value change script. Just be careful whatever your script does within a tag change script, that it executes in the single digit ms

You can get the timestamp with
currentValue.timestamp