This week's book giveaway is in the General Computing forum.
We're giving away four copies of Arduino in Action and have Martin Evans, Joshua Noble, and Jordan Hochenbaum on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes Can we set a specific date pattern for our app/webapp Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Java » Beginning Java
Reply Bookmark "Can we set a specific date pattern for our app/webapp" Watch "Can we set a specific date pattern for our app/webapp" New topic
Author

Can we set a specific date pattern for our app/webapp

Adeel Ansari
Ranch Hand

Joined: Aug 15, 2004
Posts: 2874
Can we set a specific date pattern for our application or web application without doing any work around by ourselves.

I have looked into Locale class but couldn't find anything I want. As we can set a default locale for a JVM instance. Just like the same can we set a specific date format for a JVM instance.

Moreover, can we set a locale for our application/web application not for a JVM instance. I looked into web application internationalization but it is not talking about seting a default locale or default date pattern for a web application.
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17243
    
    1

Look at the DateFormatter and DateFormat classes in the Java API Javadocs.

Mark


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
Adeel Ansari
Ranch Hand

Joined: Aug 15, 2004
Posts: 2874
Infact I have looked into DateFormat, DateFormatter, SimpleDateFormat, but I didn't find anything where I can set my specific date pattern for the whole application. I mean to say that if some other developer use,



in my application then it would suppose to print the date in the format I have already set.

So please folks, help me out. I know I can do it with some other custom utility classes but I dont wanna go for that. I just want to set a particular date pattern as a default to my whole app.

Thanks for your reply.
[ July 28, 2005: Message edited by: Adeel Ansari ]
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Can we set a specific date pattern for our app/webapp
 
Similar Threads
changing default locale
Looking for pattern in spring
Reading date from Oracle based on calendar
struts locale
switching locale...