wood burning stoves*
The moose likes Other JSE/JEE APIs and the fly likes IMAP Date Search ignoring the time Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Other JSE/JEE APIs
Bookmark "IMAP Date Search ignoring the time" Watch "IMAP Date Search ignoring the time" New topic
Author

IMAP Date Search ignoring the time

Pandiya Raj
Greenhorn

Joined: Feb 23, 2009
Posts: 2
We are downloading the message using IMAP. It is working fine and downloaded the message. We want to download the message from server by the last mail downloaded time.

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
 
 
subject: IMAP Date Search ignoring the time
 
Similar Threads
awkward date string
converting string yyyy/MM/dd to java.util.Date
SimpleDateFormat
Help for using Java Time
Java date conversion confusion...