E-mail date time zone issue

Hi,


I have an EML message with the following date in the content:

Date: Thu, 12 Mar 2015 14:50:08 +0000

But when I read that date using MailMessage.getDate() it return wrong time zone:

Thu Mar 12 14:50:08 CET 2015

It should be GMT.

I’m using the latest Aspose.Email release. Is there any workaround for this issue?
The issue occurs in both 4.4 and 5.0 versions.

Thank you,
Mariusz

MapiMessage.getClientSubmitTime returns the correct time zome, Can I use it instead? Thanks.

Hi Mariusz,


The Date Header can be set by any of the servers along the route with respective TimeZone information while the final timezone information is represented in GMT. The ClientSubmitTime property returns the time when the message was submitted by the client. However, if this time is not available, then Minimum value of the time is populated in this field which may yield wrong results. Could you please share your sample file with us for our detailed analysis? We shall look into it and assist you further.

The problem is that the getDate() method returns incorrect date/time when getClientSubmitDate() returns the correct one.

In my case(attached eml) I get the GMT time although getDate() says it’s CET.
I’m running my app on CET server and it should return 15:50 CET (as getClientSubmitDate) but it returns 14:50 CET instead. Thus, it’s a bug.
Is there any workaround for that issue?

Thank you,
Mariusz

Hi Mariusz,

Thank you for sharing your concern with us.

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

We are sorry for any inconvenience caused to you.

Can you let me know when that issue can be fixed? It is really urgent for use. Thank you.

Can you please move that issue to the Priority Support?

Thank you,
Mariusz

Hi,


The issue is planned to be fixed in the next version of Aspose.Email for Java 5.3.0. We shall notify you here once there is some information available about the fix version.

Hi, can you tell me what is the ETA for this issue/new release? Thanks. Mariusz

Hi,


The issue is planned to be fixed in the upcoming version of Aspose.Email for Java 5.3.0 that will be available for download early next month. We shall notify you here once the fix version is available for download.

Can you confirm the release date? I can see this issue is still Unresolved and this is really Critical to us. Thank you.

Hi Mariusz,


We are sorry for the trouble you are facing.

We have just checked the status of this issue with our product team and the issue is planned to be fixed in the upcoming version of Aspose.Email for Java 5.3.0. The fix version will be available in a week time and we shall notify you here once it is available for download.

Hi,


can we get some hotfix for that since I see it is fixed already? I’d like to verify it before the official release.

Thanks,
Mariusz

Hi Mariusz,

The build is under QA process now and the new version will be available in a couple of days. We request you to please have a little more patience until the fix version is available for download.

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


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

It still doesn’t work correctly.

Check the attached screenshot. I’m trying to process two .eml files withing the +2 time zone. One email is OK, the correct time is displayed, but the other doesn’t work correctly and the time returned from Aspose.Email is +1 instead of +2.

I’m attaching both emails as well.

Please fix it ASAP on priority support basis.

Email 1:


Mail: "Date: Thu, 12 Mar 2015 14:50:08 +0000"

API returns (in CET)

mapi.getClientSubmitTime() returns Thu Mar 12 15:50:08 CET 2015

message.getDate() returns Thu Mar 12 14:50:08 CET 2015


Email 2:

Mail: "Date: Thu, 14 May 2015 13:56:10 +0000"

API returns (in CET)

mapi.getClientSubmitTime() returns Thu May 14 15:56:10 CEST 2015

message.getDate() returns Thu May 14 13:56:10 CEST 2015


Why does it return different time zone and different dates based on the API used? getDate() returns incorrect date as it should be GMT not CEST, both methods returns different time zones?


Thanks in advance for solving that,

Mariusz

Hi Mairusz,

java.util.Date is timezone-independent , therefore it does not maintain the timezone information. The getLocalDate() function can be used to retrieve local date, whereas for GMT time you may use following function:

static String GetGMTTime(Date dt) {
    java.util.Calendar cal = Calendar.getInstance();
    cal.setTime(dt);
    SimpleDateFormat sdf = new SimpleDateFormat("MMM dd, yyyy HH:mm:ss");
    String asGmt = sdf.format(cal.getTime()) + " GMT";
    return asGmt;
}

public static void TestTime() {
    MailMessage mail = MailMessage.load("RE Update on ET# 12766.eml");
    System.out.println("GMT Time = " + GetGMTTime(mail.getDate()));
    System.out.println("Local Time = " + mail.getLocalDate());
}

Regarding display of wrong string (e.g. CET or CEST) while using getDate() function, we are discussing it with our product team and will share our feedback soon.

You may also have a look at this link 4 for more information on Getting Message Date Time.