OK - I feel pretty dumb asking such a basic question, but hey.
I'm trying to get the current time in a different timezone in a Java webapp. I've tried the following obvious solution: in my servlet,
Calendar localCalendar = Calendar.getInstance(myBean.getTimeZone());
then I pass the calendar object through to a JSP as a request attribute 'localCalendar':
It is now: [${requestScope.localCalendar.time}]
in TimeZone ${requestScope.localCalendar.timeZone.ID}
but my output seems to ignore the timezone set, i.e.
It is now: [Thu Nov 26 10:01:03 GMT 2009] in TimeZone Indian/Mahe
I'm guessing it's something to do with Locale settings, is there any way to just get the time formatted for my Locale, in another timezone?