Name

<fmt:setTimeZone>

Synopsis

The <fmt:setTimeZone> action sets the time zone configuration variable, establishing the time zone for all other JSTL actions that rely on one. Alternatively, the time zone may be saved as a scoped variable and provided as explicit input to other actions.

Syntax

<fmt:setTimeZone value="timeZone" 
  [var="var"] [scope="page|request|session|application"] />

Attributes

Attribute name

Java type

Dynamic value accepted

Description

value
String or java.util.
TimeZone

Yes

The time zone. If specified as a String, it’s an abbreviation, a name, or a GMT offset; see java.util.TimeZone for details.

var
String

No

The variable name. If omitted, the actions sets the time-zone context configuration variable. The type is java.util.TimeZone.

scope
String

No

The scope for the variable or the configuration variable.

Example

<fmt:setTimeZone value="GMT-8" />

Get JavaServer Pages, 3rd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.