Well, we'd faced a similar situation. My team mate added a attribute, say localTime in our form and wrote a piece of Javascript code to find the time.We called this code on load of our page and which set teh local date time value to our form attribute.It was then used in our JSP to display the Local time
Find the piece of code below :
JS
function showDate(){
var datetime= new Date();
var dateonly=datetime.getDate();
var dateyear=datetime.getFullYear();
var datemonth=datetime.getMonth();
var hours=(datetime.getHours());
var minutes=(datetime.getMinutes());
var seconds=(datetime.getSeconds());
var daytime="AM";
if (hours>12) {
daytime="PM";
hours=hours-12;
}
if(hours==12)
daytime="PM"
var totaltime=dateonly+"/"+datemonth+"/"+dateyear+" "+hours+":"+minutes+":"+seconds+" "+daytime;
document.forms[1].timedate.value=totaltime;
}
Now the timedate is added to oour form
and on page load we are calling this method
javascript
:showDate();
We are displaying this on the JSP as below
<td width="100%" align="RIGHT"><html:text property="timedate" name="OurFormName"
style="background-color:transparent;border:0px solid white;"/></td>
Hope it helps
AppleMan