AnsweredAssumed Answered

xep 0202 Entity Time

Question asked by marcos hipe on Feb 16, 2016
Latest reply on Feb 18, 2016 by marcos hipe


I'm trying to get the time of an entity (the server of the user in this case), i'm using smack 4.1.5

I suppose that i have to do something like this:

EntityTimeManager timeManager = EntityTimeManager.getInstanceFor(connection);
String time = timeManager.getTime("").getUtc();


This give me the next error:

org.jivesoftware.smack.XMPPException$XMPPErrorException: XMPPError: service-unavailable - cancel

    at org.jivesoftware.smack.XMPPException$XMPPErrorException.ifHasErrorThenThrow(XMP

    at org.jivesoftware.smack.PacketCollector.nextResultOrThrow( 32)

    at org.jivesoftware.smack.PacketCollector.nextResultOrThrow( 13)

    at org.jivesoftware.smackx.time.EntityTimeManager.getTime( 11)

Looking at the debug window, i can see that the problem is that in the iq request, the "to" parameter is missing:

<iq id="8NVJ2-22" type="get">
  <time xmlns="urn:xmpp:time"/>


Is this a bug or i am doing something wrong?

Thanks in advance