JSTL fmt:setTimeZone Formatting Tag

The JSTL <fmt:setTimeZone> Formatting Tag is used to set the specific time zone.

Syntax:

<fmt:setTimeZone value=”timeZone” />

fmt:setTimeZone tag attributes:

Attribute Description Required
value It specify the time zone to expose as a scoped or configuration variable. Yes
var It specify the name of the variable to store the new time zone. No
scope It specify the scope of the variable to store the new time zone. No

Example:

test.jsp

<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>


	
		fmt:setTimeZone JSTL formatting tag example
	
	
	      
		 
Set Time Zone to HST

web.xml


	
  
          test.jsp
  	


Output:

jsp example 70
 
Download this example.
 
Next Topic: JSTL fmt:requestEncoding Formatting Tag with example.
Previous Topic: JSTL fmt:timeZone Formatting Tag with example.