Panadol Chong Panadol Chong - 1 year ago 80
Java Question

How to display date format in other country pattern

Good day,

I have a jsp code as follow:

<fmt:formatDate value="<%= new java.util.Date() %>" pattern="EEEE, dd/MM/yyyy HH:mm:ss" />

Where by the
tag is refering to

<%@ taglib uri="" prefix="fmt" %>


So the date display in browser will be:
Monday, 07/11/2016 11:04:15

I would like to ask, any way for me to display this day in other country language? For example, in Malaysia, so it will be like:
Isnin, 07/11/2016 11:04:15

Additional question, is the
generate from the
? Because I search for my whole workspace, but didnt see any
in coding.

Kindly advise.

Answer Source

I would just change the scope to session as below

Date in France:

<fmt:setLocale value="fr_FR" scope="session"/>
<fmt:formatDate value="${now}" dateStyle="full"/> <br/>

Date in US:

<fmt:setLocale value="en_US" scope="session"/>
<fmt:formatDate value="${now}" dateStyle="full" /> <br/>
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download