In Javascript, I have this function to display the current date on our page header:
<SCRIPT language="Javascript">
var today = new Date();
document.write(today.toLocaleDateString());
</SCRIPT>
I would like to do this via JSTL, but I'm not sure if it's possible. So far, I have this fragment of code:
<jsp:useBean id="date" class="java.util.Date" />
<fmt:formatDate value="${date}" type="date" pattern="EEEE, MMMM dd, yyyy"/>
Because the date is now being created on the server, it may not represent the client's date. I believe that I can set the timeZone attribute of the formatDate function, but I'm unsure how to grab the client's timezone. Can somebody offer a suggestion?
Thanks!