# Event clear time differs between clearUnack and clearAck?

**URL:** <https://forum.inductiveautomation.com/t/event-clear-time-differs-between-clearunack-and-clearack/116607>\
**Category:** Ignition\
**Tags:** scripting, vision\
**Created:** [July 31, 2026, 6:18pm UTC](https://forum.inductiveautomation.com/t/event-clear-time-differs-between-clearunack-and-clearack/116607 "2026-07-31T18:18:18Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![charles-eloi.lafond](https://avatars.discourse-cdn.com/v4/letter/c/85e7bf/32.png) [@charles-eloi.lafond](https://forum.inductiveautomation.com/u/charles-eloi.lafond)\
**Post date:** [July 31, 2026, 6:18pm UTC](https://forum.inductiveautomation.com/t/event-clear-time-differs-between-clearunack-and-clearack/116607/1 "2026-07-31T18:18:18Z")

</div>

I'm making a small alarm journal and i want to calculate the alarm duration but I don't understand why the clear time changes between a clearUnack state and clearAck state. For example:

```python
================================================================================
Event ID: f65f0df0-c0ce-4990-be71-c0837cbe4cd2
State: Active, Unacknowledged Active: 1785336273692 Clear: None Ack: None           
State: Cleared, Unacknowledged Active: None Clear: 1785336274199 Ack: None           
State: Cleared, Acknowledged Active: None Clear: 1785338814303 Ack: 1785338814303  
================================================================================
Event ID: 796956a0-205f-4eb7-b26a-93adcf5896f8
State: Active, Unacknowledged Active: 1784923163471 Clear: None Ack: None           
State: Active, Acknowledged Active: None Clear: None Ack: 1785157744275  
State: Cleared, Acknowledged Active: None Clear: 1785165949909 Ack: 1785165949909  
================================================================================

```

The Cleared, Acknowledged event has the same timestamp for the clear and ack events which doesn't make sense to me.

Here is the script I used to print this (it's not my alarm table script but it follows the same logic and gives the same result):

```python
from collections import defaultdict

start = system.date.addDays(system.date.now(), -7)
end = system.date.now()

events = system.alarm.queryJournal(
    startDate=start,
    endDate=end
)

eventMap = defaultdict(list)

for event in events:
    clearData = event.getClearedData()
    ackData = event.getAckData()
    activeData = event.getActiveData()

    eventMap[str(event.getId())].append({
        "state": str(event.getState()),
        "active": activeData.getTimestamp() if activeData else None,
        "clear": clearData.getTimestamp() if clearData else None,
        "ack": ackData.getTimestamp() if ackData else None
    })

for eventId, records in eventMap.items():
    if len(records) > 1:
        clearTimes = set(r["clear"] for r in records)

        if len(clearTimes) > 1:
            print "=" * 80
            print "Event ID:", eventId
            for r in records:
                print "State: %-15s Active: %-15s Clear: %-15s Ack: %-15s" % (
                    r["state"],
                    r["active"],
                    r["clear"],
                    r["ack"]
                )

```

Thanks

---

<div class="post-metadata">

**Author:** ![charles-eloi.lafond](https://avatars.discourse-cdn.com/v4/letter/c/85e7bf/32.png) [@charles-eloi.lafond](https://forum.inductiveautomation.com/u/charles-eloi.lafond)\
**Post date:** [July 31, 2026, 6:20pm UTC](https://forum.inductiveautomation.com/t/event-clear-time-differs-between-clearunack-and-clearack/116607/2 "2026-07-31T18:20:48Z")

</div>

Currently my workaround for the table is if the alarm went activeUnack - \> clearedUnack - \> clearedAck, always use the clearedUnack timestamp
