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.

inside custom component

Java Development

Reply
Developer
Posts: 60
Registered: ‎05-04-2011
My Device: Torch 9800, Bold 9700, Curve 9380
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.

Developer
Posts: 1,622
Registered: ‎07-14-2008
My Device: Z10
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

 

Highlighted
Developer
Posts: 60
Registered: ‎05-04-2011
My Device: Torch 9800, Bold 9700, Curve 9380
My Carrier: None

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

Thanks a lot smiley.. Smiley Happy