Offline Message Storage - Date Format Bug?

Hello all,

I am currently developing a jabber client using the Smack library (1.5.1) and Messenger (2.2.0). Today I was working with the delayed delivery classes in order to get the correct timestamps on stored chat messages. It seems to me there is a small bug with the date format Messenger is sending to my client. All the offline message timestamps I receive on the client have a correct date and the correct digits for the time, however it does not take into account AM or PM and simply sets all the times to AM. After tracing through the code, it looks like the problem is in the simple date formatter of Messenger’'s OfflineMessageStore class (line 75):

dateFormat = new SimpleDateFormat(“yyyyMMdd’‘T’'hh:mm:ss”);

I believe the format should use “HH” for the hours instead of “hh”, so the time includes the needed information to compute the AM or PM value on the client.

I also examined the raw XML sent from Messenger using the Smack debugger and the hours were in fact off by exactly 12 hours in the afternoon. When I looked at the code for the DelayInformation class in Smack it does use “HH” for hours, so I think it is only the server that has a problem.

If I am not understanding the implementation correctly, I am open to any suggestions.

Thanks,

Chris

Chris,

Thanks for the bug report. I’'ve filed this as JM-373 and will try to get it fixed in the near future for a nightly build.

Regards,

Matt

Whoops! Looks like Gato beat us. I looked at the latest Messenger code today and it’‘s already using ‘‘HH’’. I’'ll close the issue I opened.

Regards,

Matt

Excellent, thanks for the quick response .