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);
MhtMessageFormatter mailFormatter = new MhtMessageFormatter();
mailFormatter.setDateTimeFormat("ddd, d MMM yyyy h:mm:ss a zzz");
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.
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.