I'm building a web client mail which works with the EWS Java API 2.0.
I would like to get mail from inbox according to a specific date.
This is what i have already:
public void foo(String dateToCompare){
try {
DateTime dateTime = DateTime.parse("2016-02-01T08:00:00Z");
ItemView view = new ItemView(ServiceConst.ListLimit);
SearchFilter searchFilter = new SearchFilter.IsGreaterThan(EmailMessageSchema.DateTimeReceived, dateTime);
FindItemsResults<Item> itemsList = this.exchangeService.findItems(WellKnownFolderName.Inbox,searchFilter, view);
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
And this is the error i get:
The request failed. Values of type 'org.joda.time.DateTime' can't be used for the 'Value' attribute.
I understand that the joda.DateTime class is not valid for it , so what is the alternative?