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.
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 .
GetTimeZone.java
|
Time Zone :GMT+05:30
|
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.
Ask Questions? Discuss: Get Time Zone
Post your Comment