1
0
Fork 0
mirror of https://codeberg.org/Mercury-IM/Smack synced 2024-11-27 00:32:07 +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:
Gaston Dombiak 2005-07-28 00:36:28 +00:00 committed by gaston
parent ec230924ea
commit 1ce0be62d0

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;
@ -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();