APISonar


org.jivesoftware.smackx.time.packet.Time.Time

> org > jivesoftware > smackx > time > packet > Time > Time
org APIs jivesoftware APIs smackx APIs time APIs packet APIs Time APIs Time APIs

Example 1
public void positiveTimezonTest() {
        Calendar calendar = Calendar.getInstance();
        calendar.setTimeZone(TimeZone.getTimeZone("GMT+530"));

        Time time = new Time(calendar);

        GeoLocation geoLocation = new GeoLocation.Builder().setTzo(time.getTzo()).build();

        assertEquals("+5:30", geoLocation.getTzo());

    }
Example 2
public Time getTime(Jid jid) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
        if (!isTimeSupported(jid))
            return null;

        Time request = new Time();
        // TODO Add Time(Jid) constructor and use this constructor instead
        request.setTo(jid);
        return connection().createStanzaCollectorAndSend(request).nextResultOrThrow();
    }