mirror of
https://codeberg.org/Mercury-IM/Smack
synced 2024-11-16 12:12:06 +01:00
Fixed since attribute and date format. SMACK-66
git-svn-id: http://svn.igniterealtime.org/svn/repos/smack/trunk@2515 b35dd754-fafc-0310-a699-88a17e54d16e
This commit is contained in:
parent
ec230924ea
commit
1ce0be62d0
1 changed files with 4 additions and 2 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;
|
||||
|
||||
|
@ -211,8 +212,9 @@ public class MUCInitialPresence implements PacketExtension {
|
|||
buf.append(" seconds=\"").append(getSeconds()).append("\"");
|
||||
}
|
||||
if (getSince() != null) {
|
||||
SimpleDateFormat utcFormat = new SimpleDateFormat("yyyyMMdd'T'hh:mm:ss");
|
||||
buf.append(" seconds=\"").append(utcFormat.format(getSince())).append("\"");
|
||||
SimpleDateFormat utcFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'");
|
||||
utcFormat.setTimeZone(TimeZone.getTimeZone("UTC"));
|
||||
buf.append(" since=\"").append(utcFormat.format(getSince())).append("\"");
|
||||
}
|
||||
buf.append("/>");
|
||||
return buf.toString();
|
||||
|
|
Loading…
Reference in a new issue