Welcome!

Welcome to the Official BlackBerry Support Community Forums. This is your resource to discuss support topics with your peers, and learn from each other. New to the forum? Please visit the ‘Getting Started’ link below.
inside custom component

Java Development

Reply
Developer
noopesh
Posts: 60
Registered: ‎05-04-2011
My Carrier: None
Accepted Solution

How to extract day name from the current date.

Hi, I am referring this link for formatting my date.

 

I want my date to displayed like that ;

Wed, 29 Feb 2012 07: 22: 25GMT

How to get the day from the date...???
Like 29 feb,2012 day is Wed.
How to get that thing ?
 
The remaining part I have done with this approach:
 

DateFormat dateFormat = new SimpleDateFormat( "???, dd MMM yyyy HH: mm: ss'GMT'");

Calendar c = Calendar.getInstance(TimeZone.getTimeZone("GMT"));

c.setTime(new Date(miliseconds));

String formattedDate = dateFormat.format(c, new StringBuffer(), null).toString();

System.out.println(formattedDate);

 

 Only "???" part is left. So if anyone has any idea then please help.

Please use plain text.
Developer
smiley
Posts: 1,101
Registered: ‎07-14-2008
My Carrier: Fido

Re: How to extract day name from the current date.


noopesh wrote:

Hi, I am referring this link for formatting my date.

 

I want my date to displayed like that ;

Wed, 29 Feb 2012 07: 22: 25GMT

How to get the day from the date...???
Like 29 feb,2012 day is Wed.
How to get that thing ?
 
The remaining part I have done with this approach:
 

DateFormat dateFormat = new SimpleDateFormat( "???, dd MMM yyyy HH: mm: ss'GMT'");

Calendar c = Calendar.getInstance(TimeZone.getTimeZone("GMT"));

c.setTime(new Date(miliseconds));

String formattedDate = dateFormat.format(c, new StringBuffer(), null).toString();

System.out.println(formattedDate);

 

 Only "???" part is left. So if anyone has any idea then please help.


change the ??? to EEE

 

Please use plain text.
Developer
noopesh
Posts: 60
Registered: ‎05-04-2011
My Carrier: None

Re: How to extract day name from the current date.

Thanks a lot smiley.. :smileyhappy:
Please use plain text.