mirror of
https://codeberg.org/Mercury-IM/Smack
synced 2025-09-10 18:59:41 +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:
parent
1ce0be62d0
commit
34baa2545b
2 changed files with 24 additions and 5 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue