Hello,
When I query alertlist from Nagios XI with json query, all the timestamp looks like this:
1426080059000
Unix time is actually like this? 1426080059. When I query this to show the recent alerts in some listview, can I safely divide these timestamps by 1000? Why does Nagios multiply the timestamps by 1000?
Grtz
Willem
Unix timestamp from json query
Unix timestamp from json query
Nagios XI 5.8.1
https://outsideit.net
https://outsideit.net
Re: Unix timestamp from json query
I believe that is to accommodate milliseconds should they ever be used in the future, but just in case it is actually a bug I will ask the devs.
Update: From what I understand, I was correct. It has to do with how Javascript handles the timestamp - it seems to need milliseconds.
Update: From what I understand, I was correct. It has to do with how Javascript handles the timestamp - it seems to need milliseconds.
Former Nagios employee
Re: Unix timestamp from json query
Like Trevor said: Javascript uses milliseconds for timestamps instead of just seconds. To answer if it safe to divide them by 1000, yes it is just fine.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Re: Unix timestamp from json query
Ok, thanks for confirming. Thread can be closed. 
Nagios XI 5.8.1
https://outsideit.net
https://outsideit.net