1
0
Fork 0
mirror of https://github.com/vanitasvitae/Smack.git synced 2025-09-10 17:49:38 +02:00

Improved parsing of date considering JEP-82 format. SMACK-67

git-svn-id: http://svn.igniterealtime.org/svn/repos/smack/trunk@2516 b35dd754-fafc-0310-a699-88a17e54d16e
This commit is contained in:
Gaston Dombiak 2005-07-28 00:42:29 +00:00 committed by gaston
parent 1ce0be62d0
commit 34baa2545b
2 changed files with 24 additions and 5 deletions

View file

@ -22,6 +22,7 @@ package org.jivesoftware.smackx.packet;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.TimeZone;
import org.jivesoftware.smack.packet.PacketExtension;
@ -38,6 +39,18 @@ import org.jivesoftware.smack.packet.PacketExtension;
public class DelayInformation implements PacketExtension {
public static SimpleDateFormat UTC_FORMAT = new SimpleDateFormat("yyyyMMdd'T'HH:mm:ss");
/**
* New date format based on JEP-82 that some clients may use when sending delayed dates.
* JEP-91 is using a SHOULD other servers or clients may be using this format instead of the
* old UTC format.
*/
public static SimpleDateFormat NEW_UTC_FORMAT =
new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'");
static {
UTC_FORMAT.setTimeZone(TimeZone.getTimeZone("GMT+0"));
NEW_UTC_FORMAT.setTimeZone(TimeZone.getTimeZone("UTC"));
}
private Date stamp;
private String from;