Get the current TimeZone using the Calendar class

This example shows how to get and display the current timezone using the Calendar class.
First we create a Calendar instance using the static method getInstance(). Then call the getTimeZone() method to get a TimeZone object.
Finally we call the getDisplayName() method which returns the current timezone as a string, which we send to System.out.

Search for more Java info on this site here:
Custom Search

Any thoughts or questions?