When using the taglib library, I'm tring to format a java.util.Date with a pattern as well as a timezone. However, I can't seem to get the Timzone piece to work. Here's a sample piece of code... <dt:timeZone id="tz">myObject.getTimeZone().getID()</dt:timeZone> <dt:format pattern="MM/dd/yy hh:mm:ss a z" timeZone="tz" date="<=item.getDateDue()%>"></dt:format> Where myObject.getTimeZone().getID() returns "MST" and item.getDateDue() returns a java.util.Date Whenever I run this code, the output always shows in GMT.
Sorry it has taken me this long to look into this. I see a problem with your code. <dt:timeZone id="tz">myObject.getTimeZone().getID()</dt:timeZone> The above tries to set the time zone to the string literal "myObject.getTimeZone().getID()" instead of its value. If the timezone tag is passed an invalid timezone string it uses the system default. Try this: <dt:timeZone id="tz"><%= myObject.getTimeZone().getID() %></dt:timeZone> The problem looks like it is in your code, not the taglib.