Win a copy of Emmy in the Key of Code this week in the General Computing forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Ron McLeod
  • Carey Brown
Bartenders:
  • Paweł Baczyński
  • Piet Souris
  • Vijitha Kumara

Date Format Problem

 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HI,

I need to format date in the given format ( for example 08-MAY-11 ). I used 'dd-MMM-yy' format , but i am getting the month value as May and not MAY. Is there any format that can be used in java which return month in three letter with full caps (eg: MAY).

piece of code is given below:




Thanks
 
Master Rancher
Posts: 3396
33
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Offhand I don't know of any DateFormat specifier that would do this. But... have you looked at the API for java.lang.String? Perhaps a method to convert a string to upper case?
 
Marshal
Posts: 66140
250
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you have a Date object, a Calendar object, or a L/long, you can get date and time information printed out with the options of formatter.
 
Curse your sudden but inevitable betrayal! And this tiny ad too!
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!