dcsimg
problem with message.getSentDate();
2 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   gurpreet_ahluwalia
Posted On:   Thursday, March 21, 2002 12:50 AM

the problem i am facing is that... message.getSentDate(); will show .. Sat Mar 16 11:49:09 GMT+05:30 2002 this format is ok when you display each message separately on different page. but when you are diplaying just limited fields on first page .. like message.getFrom()[0]; message.getSubject(); and displaying the size of the message. now i also want to display the sent date of the message.. but this will return Sat Mar 16 11:49:09 GMT+05:30 2002 which is long and awkward.. i want to display the date something like in this format    More>>

the problem i am facing is that...

message.getSentDate();

will show ..



Sat Mar 16 11:49:09 GMT+05:30 2002



this format is ok when you display each message separately on different page.

but when you are diplaying just limited fields on first page ..



like message.getFrom()[0];


message.getSubject();


and displaying the size of the message.



now i also want to display the sent date of the message.. but
this will return



Sat Mar 16 11:49:09 GMT+05:30 2002


which is long and awkward..


i want to display the date something like in this format



Fri 02/22/02 01:30 AM

plz help me sir..

   <<Less

Re: problem with message.getSentDate();

Posted By:   John_Zukowski  
Posted On:   Thursday, March 21, 2002 08:12 AM

The DateFormat class lets you format dates.

Re: problem with message.getSentDate();

Posted By:   Sean_Ruff  
Posted On:   Thursday, March 21, 2002 08:11 AM

You could use the SimpleDateFormat to accomplish what you are looking for.



java.text.SimpleDateFormat formatter = new java.text.SimpleDateFormatter("E MM/dd/yy hh:mm a");
String formattedDate = formatter.format(message.getSentDate());



Hope this helps.
About | Sitemap | Contact