Alarm Expired Timestamp and End Time Properties always return "Monday, January 1, 0001, 12:00:00 AM" even the keep day(s) is set to 30 days in Management Client Alam Settings

Hi,

I have developed my standalone application with MIPSDK (with refers to Component Sample: AlarmViewer) which read all the alarms from the Milestone server.

What I would like to retrieve with the SDK is the “expire date” of the alarm.

By “expire date” I mean the date as set in

Management Client > Tools > Options > Alarms and Events > Alarm settings:

Keep all other alarms for: (e.g. 30 days)

I tried reading it with the two of the following properties:

  • alarm.EventHeader.ExpireTimestamp
  • alarm.EndTime

but both of them returned the DateTime “Monday, January 1, 0001, 12:00:00 AM” where my expected DateTime is “Thursday, December 12, 2019, 12:00:00 AM”, 30 days from today when 30 days are set in Management Client.

Attached below the section of code that I use to log the Information.

Thanks.

_alarmClientManager = new AlarmClientManager();
                AlarmClient = _alarmClientManager.GetAlarmClient(EnvironmentManager.Instance.MasterSite.ServerId);
                AlarmLine[] alarms = AlarmClient.GetAlarmLines(0, 100, new AlarmFilter()
                {
                    Orders = new OrderBy[] { new OrderBy() { Order = Order.Descending, Target = Target.Timestamp } }
                });
 
                int ii = 0;
                foreach (AlarmLine line in alarms)
                {
                    Log($"Init: LoadVmsAlarm[{ii}]: {line.Id}");
                    var alarm = AlarmClient.Get(line.Id);
                    VmsAlarmCollection.Add(alarm);
                    Log($"      LoadVmsAlarm[{ii}]: {alarm.EventHeader.ExpireTimestamp.ToLongDateString()},{alarm.EventHeader.ExpireTimestamp.ToLongTimeString()}");
                    Log($"      LoadVmsAlarm[{ii}]: {alarm.EndTime.ToLongDateString()}, {alarm.EndTime.ToLongTimeString()}");
                    ii++;
                }
            }

Let me explain about the properties first.

VideoOS.Platform.Data.Alarm.EndTime … The end time of alarm. In some cases an alarm doesn’t happen only in a moment that is triggered, it has a certain short period of time.

VideoOS.Platform.Data.EventHeader.ExpireTimestamp … The ExpireTimestamp is not used for alarms – they all expire according to the central expiration setting in Management Client. EventHeader is shared between events and alarms and for events the ExpireTimestamp field is used (as events can have different expiration times).

Finally, to answer your initial question: The alarm expiration time is an internal setting which unfortunately is not available in the SDK.