Javatpoint Logo
Javatpoint Logo

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

Test it Now

Output:

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

Example 2

Test it Now

Output:

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


Help Others, Please Share

facebook twitter pinterest