Java Calendar setTimZone() Method

The setTimZonee() method of java.util.Calendar class is used to set the TimeZone with the passed TimeZone value(object) as a parameter.

Syntax

Parameter

value - value which is to set as TimeZone.

Returns

NA

Throws

NA

Example 1

Output:

TimeZone:Pacific Standard Time
Time Zone after changing to GMT:Greenwich Mean Tim

Example 2

Output:

Display Name of Current TimeZone (mycal2) :Pacific Standard Time
Display Name of TimeZone (mycal3):Pacific Standard Time