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

Date object

 
Eric Christensen
Greenhorn
Posts: 15
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have some code that I'm using to try and format dates between US and Canada. When I use the code in a stand alone:

everything works great. If I change the regional settings, everything is cool, I see the different formats and all. Now when I transform the code above into a servlet:

the date format never changes. I'm deploying this servlet in a test environment with Eclipse on my local machine, so shouldn't it be looking at my local settings? Is my code okay? Thanks in advance!
 
Avi Abrami
Ranch Hand
Posts: 1141
1
Java Oracle
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Eric,
I think the key lies here
If I change the regional settings, everything is cool

but I couldn't find any details in your post about how you are changing your regional settings.
Also, the servlet engine may not allow you to change regional settings the same way that you can with a stand-alone java application. But again, I didn't see any details in your post about which servlet engine you are using.
Hope this has helped you.
Good Luck,
Avi.
 
Eric Christensen
Greenhorn
Posts: 15
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I changed the regional settings in Windows. Control panel, region and language settings.
I'm using WSAD which runs WebSphere. I am testing with a 'test environment' which is something like running a little app server on the pc to see how the app would work deployed to a real server.
 
Vijesh Pavithran
Greenhorn
Posts: 2
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Did you try restarting the server everytime you make a change in the regional settings?.
 
Eric Christensen
Greenhorn
Posts: 15
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes. In fact I changed it to 'French' language and formatting and such. When I restarted the server, all of the server messages and such were in french, but the output was in the U.S. format.
 
Eric Christensen
Greenhorn
Posts: 15
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Somehow now the servlet is working. Arrrggggh. I don't know why but it is. I definitely restarted earlier. Thanks for all your help though.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic