• Post Reply Bookmark Topic Watch Topic
  • New Topic

formatDate issue  RSS feed

mahesh rao
Posts: 19
  • Mark post as helpful
  • send pies
  • 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 ?
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!