We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

MhtMessageFormatter and Time Zone support

Hello, I’m using the Java version of Aspose Email. I’m saving out an MHtml document, but need to change the Date Time Format. Based on other forum posts i’ve come up with the following code that gets me 99% of the way there.

MailMessage mailMessage = MailMessage.load(file.toString(), options);
mailMessage.setTimeZoneOffset(project.getTimeZone().getOffset(sentDate.getTime()));

MhtMessageFormatter mailFormatter = new MhtMessageFormatter();
mailFormatter.setDateTimeFormat("ddd, d MMM yyyy h:mm:ss a zzz");
mailFormatter.format(mailMessage);

mailMessage.save(outputStream, MailMessageSaveType.getMHtmlFormat(), MailMessageSaveOptions.None);

But now here's the problem. #1 -- I can't find ANY documentation on what date time format patterns your platform accepts. I assumed you'd be using Java SimpleDateTime or JodaTime formats, but the closest I could find was the Microsoft MSDN patterns: http://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.90).aspx

So from trial and error and the MSDN documentation I came up with that DateTimeFormat string listed above. The problem I'm seeing is that the timezone offset isn't displaying correctly.

TimeZone: America/Denver
Input SentDate: 2011-01-13T19:28:38Z
Output SendDate:
Thu, 13 Jan 2011 12:28:38 PM +00:00

As you can see the actual time seems to have adjusted correctly, but the timezone is listing "+00:00". When I would expect: "-07:00" for Mountain Standard Time. When I don't specify a format at all I get the correct time and offset, but the offset is listed at "-0700" (no colon?).

Thanks! Hopefully I can get this sorted out quickly.

-Eric

Hi Eric,


We are sorry for a delayed response and would request you to spare us a little time to investigate this issue at our end. We’ll get back to you with our findings as soon as possible and appreciate your cooperation in this regard.

Hi Eric,

I was able to reproduce this issue at my end using the latest version of Aspose.Email for Java 4.1.0 and have logged it as NETWRKJAVA-33382 in our issue tracking system for further investigation by our development team. Once there is any information available in this regard, we’ll update you here via this thread here.

Regarding your query about supported datetime formats by Aspose.Email, I would like to share that we follow RFC 5322 as given [here ](http://tools.ietf.org/html/rfc5322#section-3.3).

We are sorry for the inconvenience caused to you.

The issues you have found earlier (filed as NETWRKJAVA-33382) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by Aspose Notifier.