• Post Reply Bookmark Topic Watch Topic
  • New Topic

SHORT date style and US Locale  RSS feed

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

i've got following problem with SimpleDateFormat: when using US locale and date style SHORT, formatted date looks like 4/20/09. But we have requirement that the size of this string should be always equal, that means essentially that days and months should be zero padded. Specifying the pattern is not an option since the same code will be used with other locales. The best solution that I came up with was manually go through the pattern and expand months and days to two letters if only one present, but this looks a bit messy.

How do you go about this? Any help is appreciated.
 
Author and ninkuma
Marshal
Posts: 66307
152
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moved to a more appropriate forum.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!