Closed mkassir95 closed 1 year ago
That API command is implemented in https://github.com/processone/ejabberd/blob/d26a9d583f9c22ece39bc5bdb170154537cd94c7/src/mod_admin_extra.erl#L1447
When the account has an online session, the API command returns the current time, as provided by the functions:
xmpp_util:encode_timestamp(erlang:timestamp()).
<<"2023-01-09T15:50:28.363891Z">>
For example:
$ ejabberdctl get_last user1 localhost
2023-01-09T15:47:05.486570Z ONLINE
$ ejabberdctl get_last user1 localhost
2023-01-09T15:47:06.068793Z ONLINE
When the last session disconnects, then it returns the timestamp of that disconnection:
2023-01-09 16:47:12.774997+01:00 [info] (tls|<0.1424.0>)
Closing c2s session for user1@localhost/tka1:
Stream reset by peer
$ ejabberdctl get_last user1 localhost
2023-01-09T15:47:12Z Stream reset by peer
Maybe the time in your server machine is wrong?
@badlop thank you. Maybe I it is a time sycronization issue.
time stamp is not correct it differs by some minutes from the real time I am using http://localhost:5281/api/get_last