Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Java Mail - IMAP Date Search ignoring the time

843834Feb 23 2009 — edited Feb 23 2009
I am downloading the message using IMAP. It is working fine and downloaded the message. I want to download the message from server by the last mail downloaded time.(Which i have maintained in the local system)

code is,

SimpleDateFormat simpleDateFormat = new SimpleDateFormat("EEE MMM dd HH:mm:ss Z yyyy");
Date temprecvDate = simpleDateFormat.parse("Sun Feb 22 23:00:00 CST 2009");
ReceivedDateTerm recvDateTerm = new ReceivedDateTerm(ReceivedDateTerm.GT, temprecvDate);
messages = inboxFolder.search(term);
..
..
..

The following debug message we got

A4 OK [READ-ONLY] EXAMINE completed.
A5 SEARCH SINCE 22-Feb-2009 ALL
* SEARCH 24379 24380 ......
....

It seems to be search is disregarding the time in the search. How can we achieve this? I want to retrieving the message based on time.

thanks in advance
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 23 2009
Added on Feb 23 2009
1 comment
600 views