Dear Team,
We are having the following issue where the timezone is not getting accounted in aspose email java component. We used the following code snippet to set the sent date but the msg file after generation is not accounting the DST. I also tried setting the timezone offset but its the same issue again. Can someone pls let me know if iam doing something wrong to set the timezone offset?
Attached is the sample code for reference. We use the latest aspose.email 3.1 jar for testing and the machine running this test is on GMT timezone.
We also see that mailmessage always considers GMT as the default timezone
Pls see the following code snippet
XMLGregorianCalendar cal= DatatypeFactory.newInstance().newXMLGregorianCalendar(“2013-08-02T15:17:36.000+01:00”);
Date date=cal.toGregorianCalendar().getTime();
System.out.println("Date: "+ date);
message.setDate(cal.toGregorianCalendar().getTime());
System.out.println("Message Date: "+ message.getDate());
If i change my locale to EDT, i have the following values printed
Creating new messages…
Date: Fri Aug 02 10:17:36 EDT 2013
Message Date: Fri Aug 02 14:17:36 EDT 2013
When i open the created email, i see the sent date as 14:17 and i would expect it to show 10:17 as per the locale i have selected on my desktop.
Can someone confirm on this behaviour?
Hi Kiran,