Date format of chat's start Attribute for collection item or message may be wrong ?? (#27)
veiky sun opened 8 years ago
  1. One in AbstractMessageArchiveRepository
	formatter2 = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssZ")
	...
	formattedStart = formatter2.format(start);
  1. Another in TimestampHelper
	formatter2 = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssZ");
	...
	public static String format(Date ts) {
		synchronized (formatter2) {
			return formatter2.format(ts);
		}
	}

"yyyy-MM-dd'T'HH:mm:ssZ" will format date to string like "2016-02-24T16:52:13+0000"

but "yyyy-MM-dd'T'HH:mm:ss'Z'" will format date to string like "2016-02-24T16:52:13+00:00", as is protocoled in

  1. http://xmpp.org/extensions/xep-0136.html#manage-list

  2. http://xmpp.org/extensions/xep-0082.html#sect-idp621488

TZD Time Zone Definition (either "Z" for UTC or "(+|-)hh:mm" for a specific time zone)

  • A string like "2016-02-24T16:52:13+0000" cannt be Deserialized by some other xmpp softwares
Andrzej Wójcik (Tigase) commented 8 years ago

I fixed format of timestamp by changing yyyy-MM-dd'T'HH:mm:ssZ to yyyy-MM-dd'T'HH:mm:ssXXX and @yyyy-MM-dd'T'HH:mm:ssXX@.

First one properly handles timestamps like 2016-02-24T16:52:13+01:00 and 2016-02-24T16:52:13Z@, while second one handles @2016-02-24T16:52:13+0100 anf @2016-02-24T16:52:13Z@. This way Tigase Message Archiving component will properly handle format described at http://xmpp.org/extensions/xep-0082.html#sect-idp621488 and format which was handled until now (for backward compatibility).

From now on Tigase Message Archiving component will return timestamps in following form 2016-02-24T16:52:13Z

Usage of format string suggested in task description is not possible. yyyy-MM-dd'T'HH:mm:ss'Z' will result in formatting time properly however will lead to timezone information being lost (especially as in some cases this formatter is also used for parsing timestamps!)

veiky sun commented 8 years ago

官方阿迪达斯新店开张大促销了,三折呀,还有情侣款,我卖了两双,去验过是正品,很满意~!http://st.zzaa.org

This is an automatic reply, confirming that your e-mail was received.Thank you

邮箱使用小提示


想让对方更及时看到你的邮件,可以试试发到"对方手机号@163.com"。



无需事先开通,还有短信提醒。了解网易手机邮箱详情
issue 1 of 1
Type
Bug
Priority
Major
Assignee
RedmineID
4188
Issue Votes (0)
Watchers (0)
Reference
tigase/_server/tigase-message-archiving#27
Please wait...
Page is in error, reload to recover