Get Time Zone
Time Zone class inherits from a Java.util.time zone. This class represents a time zone offset. The Time zone gives you a specific time zone of a specific locale where the program is running. In case a program running in USA,This class creates a time zone object based on USA.
Understand with Example
In this Tutorial we want to describe you a code that help you in understanding a Get Time Zone. For this we have a Class name Get Time Zone. Inside the main method the calendar class call a get Instance ( ) method returns you the default zone and locale and in order to get an instance of calendar class in a calendar object. The calendar object calls getTimeZone method and return the calendar current's time of the zone by System.out.println. method. Time Zone ( ) is a static method that return you all the Id supported. Date Format is a abstract class used for date, time formatting class.
Date Format df = DateFormat.getDateInstance( ) - The DateFormat.getDateInstance returns you the date for the different locale. This provides you to get the time format for a specified country.
The System.out.println print the time zone for a given id .