This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Locale Class

 
Jitendra Jha
Ranch Hand
Posts: 92
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I was trying to work through this code

import java.util.*;
import java.text.*;

class LocaleC
{

public static void main(String[] srt)
{
Calendar cc=Calendar.getInstance();
cc.set(1998,04,19);
Date d=cc.getTime();
System.out.println(d);

Locale lc=new Locale("it","IT");
DateFormat df=DateFormat.getDateInstance(DateFormat.FULL,lc);
String s=df.format(d);
System.out.println(d);

}
}



this code is supposed to give me locale specific information about Italy which it does not.
I am unable to figure out my mistake.Please help

Jitendra
 
Jitendra Jha
Ranch Hand
Posts: 92
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry, i figured out my mistake
It was the wrong print statement on the last line.
I should have passed s instead of d
Sorry again to have wasted your precious time

Jitendra
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic