Filteralarm for Acknowledged alarms that have been acknowledged less than 12 hours

I am trying to use the filteralarm script to have our alarm status table show acknowledged alarms that have been acknowledged for less than 12 hours.

Using the IsAcked, AckTime, and other scripting functions I came up with this:
site = alarmEvent.get(“Site”)
first = system.date.now()
second = alarmEvent.get(“AckTime”)
ACKED = alarmEvent.get(“IsAcked”)
TIME = system.date.hoursbetween(first, second)
tagname = “[Client]” + site + “AlarmFilter”
FilterFlag = system.tag.read(tagname)
if TIME.value <= 12 and ACKED == True or FilterFlag.value == True:
return True
return False

Seems like the filterflag is working, but it is not showing the acknowledged alarms that have been acknowledged less than 12 hours.
Any ideas?

IF this is a direct copy and paste from your script. I believe you will need to set the B to upper case in the system.date.hoursBetween(first,second) function.

Also, TIME will be an integer, so you don’t need TIME.value, just switch it to TIME in your IF statement.