until 4.2.1 version, the “Sent” format was ok.
The latest version 4.3.0 has “Sent” format problem.
Old version:
New version has wrong format:
Here is my codes:
Calendar c = Calendar.getInstance(timezone); // omit timezone for default tz
c.setTime(message.getDate()); // your date; omit this line for current date
int dateOffsetInt= c.get(Calendar.DST_OFFSET);
int offSetint = Double.valueOf(offset).intValue()+dateOffsetInt;
offset = Double.parseDouble(offSetint + “”);
message.setTimeZoneOffset(offset);
MhtMessageFormatter mhtlFormat = new MhtMessageFormatter();
mhtlFormat.setDateTimeFormat(“EEEE, MMMM dd, yyyy hh:mm:ss a”);
int formatOptions = MhtFormatOptions.HideExtraPrintHeader | MhtFormatOptions.WriteCompleteEmailAddressToMht;
mhtlFormat.format(message, formatOptions);
message.save(baseFolder + htmlFileName, MailMessageSaveType.getMHtmlFormat(), MailMessageSaveOptions.None);
The issues you have found earlier (filed as NETWRKJAVA-33395) have been fixed in this update.
This message was posted using Notification2Forum from Downloads module by Aspose Notifier.
The format is fixed. But the Sent time is not correct.
I already posted a simple message file last Friday to test. please test the message file or your email file and check the “Sent” time.
The Sent time in the converted PDF is not consistent.
4.4.0 and 4.2.1 have different “Sent” time value.
Here is my code your team gave me:
TimeZone timezone = TimeZone.getTimeZone(“America/Los_Angeles”);
double offset = timezone.getOffset(Calendar.ZONE_OFFSET);
Calendar c = Calendar.getInstance(timezone); // omit timezone for default tz
c.setTime(message.getDate()); // your date; omit this line for current date
int dateOffsetInt= c.get(Calendar.DST_OFFSET);
int offSetint = Double.valueOf(offset).intValue()+dateOffsetInt;
offset = Double.parseDouble(offSetint + “”);
message.setTimeZoneOffset(offset);
MhtMessageFormatter mhtlFormat = new MhtMessageFormatter();
mhtlFormat.setDateTimeFormat(“EEEE, MMMM dd, yyyy hh:mm:ss a”);
int formatOptions = MhtFormatOptions.HideExtraPrintHeader | MhtFormatOptions.WriteCompleteEmailAddressToMht;
mhtlFormat.format(message, formatOptions);
message.save(baseFolder + htmlFileName, MailMessageSaveType.getMHtmlFormat(), MailMessageSaveOptions.None);
Thanks,
Chang Shin
Hi Chang,
The issues you have found earlier (filed as ) have been fixed in this update. This message was posted using BugNotificationTool from Downloads module by MuzammilKhan