• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

SimpleDateFormat problem....

 
Tom Diamond
Ranch Hand
Posts: 98
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
I have created a SimpleDateFormat object in a JSP as follows :

But when I try to print it on the browser, instead of letters for the day and the month I get stange chars. I guess that the problem exists because the default language of my system is Greek so Java thinks that everything should be in Greek. Is there away to fix this?
Tom.
 
Nirvana_417
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
make use of the SimpleDateFormat() construct which uses the Locale object ..
eg
...
formatter = new SimpleDateFormat("MM'/'dd'/'yyyy 'at' hh:mm:ssa" ,Locale.US);
Date today = new Date();
dateTime = formatter.format(today);
..
Use the Locale that U want for your program .
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic