• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

formatDate issue

 
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am getting today's date using java.util.Date and formatting using formatDate tag.

<jsp:useBean id="now" class="java.util.Date" />
<fmt:formatDate value="${now}" pattern="dd-MMM-yyyy" var="todayDate" />

However, when I display ${todayDate}, it is displaying differently for users depending on their system and browser settings.

For example, for a korean user, it displays 31-10?-2008 (notice the ? after month). For a sweden user, it displays 31-Okt-2008 (notice Okt instead of Oct).

Setting the locale and timezone on the page did not solve the problem.
<fmt:setLocale value='en-US' scope="page" />
<fmt:setTimeZone value='America/New_York' scope="page" />

What am I missing ?
reply
    Bookmark Topic Watch Topic
  • New Topic