1
0
Fork 0
mirror of https://github.com/vanitasvitae/Smack.git synced 2024-11-26 22:12:05 +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.text.SimpleDateFormat;
import java.util.Date; import java.util.Date;
import java.util.TimeZone;
import org.jivesoftware.smack.packet.PacketExtension; import org.jivesoftware.smack.packet.PacketExtension;
@ -211,8 +212,9 @@ public class MUCInitialPresence implements PacketExtension {
buf.append(" seconds=\"").append(getSeconds()).append("\""); buf.append(" seconds=\"").append(getSeconds()).append("\"");
} }
if (getSince() != null) { if (getSince() != null) {
SimpleDateFormat utcFormat = new SimpleDateFormat("yyyyMMdd'T'hh:mm:ss"); SimpleDateFormat utcFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'");
buf.append(" seconds=\"").append(utcFormat.format(getSince())).append("\""); utcFormat.setTimeZone(TimeZone.getTimeZone("UTC"));
buf.append(" since=\"").append(utcFormat.format(getSince())).append("\"");
} }
buf.append("/>"); buf.append("/>");
return buf.toString(); return buf.toString();