本文整理汇总了Java中org.jxmpp.util.XmppDateTime.parseDate方法的典型用法代码示例。如果您正苦于以下问题:Java XmppDateTime.parseDate方法的具体用法?Java XmppDateTime.parseDate怎么用?Java XmppDateTime.parseDate使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.jxmpp.util.XmppDateTime
的用法示例。
在下文中一共展示了XmppDateTime.parseDate方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getExpiry
import org.jxmpp.util.XmppDateTime; //导入方法依赖的package包/类
/**
* Get the time at which the leased subscription will expire, or has expired.
*
* @return The expiry date
*/
public Date getExpiry()
{
String dateTime = getFieldValue(SubscribeOptionFields.expire);
try
{
return XmppDateTime.parseDate(dateTime);
}
catch (ParseException e)
{
UnknownFormatConversionException exc = new UnknownFormatConversionException(dateTime);
exc.initCause(e);
throw exc;
}
}
示例2: getTime
import org.jxmpp.util.XmppDateTime; //导入方法依赖的package包/类
/**
* Returns the local time or <tt>null</tt> if the time hasn't been set.
*
* @return the local time.
*/
public Date getTime() {
if (utc == null) {
return null;
}
Date date = null;
try {
date = XmppDateTime.parseDate(utc);
}
catch (Exception e) {
LOGGER.log(Level.SEVERE, "Error getting local time", e);
}
return date;
}
示例3: validatePresenceWithDelayedDelivery
import org.jxmpp.util.XmppDateTime; //导入方法依赖的package包/类
@Test
public void validatePresenceWithDelayedDelivery() throws Exception {
String stanza = "<presence from='[email protected]' to='[email protected]'>"
+ "<delay xmlns='urn:xmpp:delay' stamp='2002-09-10T23:41:07Z'/></presence>";
Presence presence = PacketParserUtils.parsePresence(PacketParserUtils.getParserFor(stanza));
DelayInformation delay = DelayInformationManager.getXep203DelayInformation(presence);
assertNotNull(delay);
Date date = XmppDateTime.parseDate("2002-09-10T23:41:07Z");
assertEquals(date, delay.getStamp());
}
示例4: parseDate
import org.jxmpp.util.XmppDateTime; //导入方法依赖的package包/类
@Override
protected Date parseDate(String string) throws ParseException {
return XmppDateTime.parseDate(string);
}