Free Support Forum - aspose.com

MapiCalendar and TimeZone since Aspose.Email 18.8

We faced a change in Aspose.Email for Java 18.8 - the start and end date of MapiCalendar are now in UTC. There is a MapiCalendarTimeZoneInfo. How do I get the same date as in 18.7 considering the DST?

The change in the API from the date with considered timezone to UTC should be mentioned in the release notes of Aspose.Email for Java 18.8! If we would not test this in our Unittests, we would have documents with wrong date!

Thanks in advance

Josef

@dvtdaten

We have hotfix release 18.8.6 in which the changes with UTC DateTime in MapiProperty are corrected. Please find hotfix release at this link:
https://www.dropbox.com/s/1vgun1cblivefld/aspose-email-18.8.6-java.zip?dl=0
Moreover, this would be a part of our next release i.e 18.9.

With Aspose.Email 18.9 for Java same question as before: “How do I get the same date as in 18.7 considering the DST?”

The dates are still in UTC in 18.9 - no change on our side?

Regards,

Josef

@dvtdaten

It is requested to please provide your sample code for getting dates and please also mention your required/ expected datetime output. However, it would be helpful if you could provide sample data (EML or PST) file for detailed investigation.

Testfile: test.zip (23.7 KB)

You find a test.msg in the zip-File. We faced the problem, that the appointment start- and end-date has a difference of 2 hours to our local time zone. in 18.9 there is also a difference in the year (2 years).

How can we get the correct date as in the test.msg file. See attached screenshots for details (System.out vs. Outlook).

Code is very simple:
MapiMessage mapiMessage = MapiMessage.fromFile(“C:\temp\test.msg”);
MapiCalendar cal = (MapiCalendar) mapiMessage.toMapiMessageItem();
System.out.println("Beginn: " + cal.getStartDate());
System.out.println("Ende: " + cal.getEndDate());

@dvtdaten

We have found that the time difference is of half hour in local time zone as shown in output:

Beginn: Wed Oct 05 14:30:00 CEST 2016
Ende: Wed Oct 05 15:00:00 CEST 2016

The MSG file provided contains an appointment which shall occur every 2 years starting from 10/05/2016. So the console output shows the start and end date as 10/05/2016 and the time shown is in local time zone. Whereas, as per our understanding the date shall be of 10/05/2018.

So, we have logged this issue with ID “EMAILJAVA-34432” for further investigation. You will automatically be informed here once we have more information to share.

I tried an appointment without repetition. I face the problem with 2 hours. The date is correct. If you read UTC time, please tell me how to get the correct time with timezone, respecting the DST.

In the example before, starting date of the whole timeseries is indeed in 2016, thats correct.

Example: test (2).zip (7.5 KB)

Outlook:
16:30 - 17:10
System.out:
Beginn: Tue Oct 09 14:30:00 CEST 2018
Ende: Tue Oct 09 15:00:00 CEST 2018

@dvtdaten

We have recorded the details provided regarding the 2 hours difference with UTC. We are working on this issue and we will update you as soon as we have more information to share.

@dvtdaten

We have prepared Aspose.Email for Java 18.9.1 hotfix release for this issue. Please download this release from the link given below:
https://www.dropbox.com/s/lzjb62gphl9szwd/aspose-email-18.9.1-java.zip?dl=0

Moreover, please share your feedback with us and you may try the following test code:

MapiMessage mapiMessage = MapiMessage.fromFile(pathToMsg);
MapiCalendar cal = (MapiCalendar) mapiMessage.toMapiMessageItem();

System.out.println("StartDate: " + cal.getStartDate());
System.out.println("EndDate: " + cal.getEndDate());
System.out.println("----------------------------------");
System.out.println("ClipStart: " + cal.getRecurrence().getClipStart());
System.out.println("ClipEnd: " + cal.getRecurrence().getClipEnd());
System.out.println("----------------------------------");
System.out.println("Recurrence StartDate: " + cal.getRecurrence().getRecurrencePattern().getStartDate());
System.out.println("Recurrence EndDate: " + cal.getRecurrence().getRecurrencePattern().getEndDate());

Thanks, it works - same way as before 18.8.

@dvtdaten

Thank you very much for your feedback, we are glad to know that the issue is resolved.
You are always welcome and please feel free to write us if you have any query in future.

The issues you have found earlier (filed as EMAILJAVA-34432) have been fixed in this update. This message was posted using BugNotificationTool from Downloads module by MuzammilKhan