This week's giveaway is in the EJB and other Java EE Technologies forum.
We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line!
See this thread for details.
The moose likes Servlets and the fly likes SimpleDateFormat problem.... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "SimpleDateFormat problem...." Watch "SimpleDateFormat problem...." New topic
Author

SimpleDateFormat problem....

Tom Diamond
Ranch Hand

Joined: May 10, 2001
Posts: 98
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

Joined: Oct 15, 2001
Posts: 4
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 .
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: SimpleDateFormat problem....
 
Similar Threads
date format
convert a string to java.sql.Date object
set JVM timezone in Linux
Saving system date
date format