Javatpoint Logo
Javatpoint Logo

Java Calendar getTimeZone() Method

The getTimeZone() method of java.util.Calendar class gets the TimeZone of calendar object and returns a TimeZone object.

Syntax

Parameter

No parameter is passed.

Returns

Returns the TimeZone object.

Throws

Does not throw an exception.

Example 1

Test it Now

Output:

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

Example 2

Test it Now

Output:

Display Name of Current TimeZone Pacific Standard Time



Please Share

facebook twitter google plus pinterest