You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jun 18, 2024. It is now read-only.
According to the wiki docs we need to use dates converted to UTC before passing it to the API as seen below:
Date and Time Zone
Time and date details that you set by using the java.util.Date class are given as UTC. When you set the date by using the Date class, make sure that it is in UTC time.
For example, if you're creating an Appointment from 10:00 am to 11:00 am on 20-09-2010 as per IST Indian Standard Time (which is +5:30 hours from UTC), the Time should be given in UTC, as shown in the following example.
Appointment appointment = new Appointment(service);
appointment.setSubject("Appointment TEST for TimeZone Check");
appointment.setBody(MessageBody.getMessageBodyFromText("Test Body Msg"));
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
Date startDate = formatter.parse("2012-09-20 04:30:00");
Date endDate = formatter.parse("2012-09-20 05:30:00");
appointment.setStart(startDate);
appointment.setEnd(endDate);
appointment.save();
However, I have an e-mail in an account that was received at 2016-07-05 01:45 EST and when I retrieve the e-mails in UTC (currently +4) by sending in 2016-07-05 05:45 it no longer finds the e-mail. I now have to send in 2016-07-04 21:45 in order for it to work. When I remove the UTC conversion and pass in the original date 2016-07-05 01:45 it does indeed find the e-mail. I am also including a subject filter, from e-mail, attachment filter, and HasAttachments = true. Has the date handling changed and the wiki docs need to be updated?