Skip to content
This repository was archived by the owner on Jun 18, 2024. It is now read-only.
This repository was archived by the owner on Jun 18, 2024. It is now read-only.

Searching for e-mails by date range no longer uses UTC #544

@derylspielman

Description

@derylspielman

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions