Java TimeZone classJava TimeZone class represents a time zone offset, and also figures out daylight savings. It inherits the Object class. Java TimeZone class declarationLet's see the declaration of java.util.TimeZone class. Methods of Java TimeZone
Java TimeZone class Example: getAvailableIDs()Test it NowOutput: In TimeZone class available Ids are: Africa/Abidjan Africa/Accra Africa/Addis_Ababa Africa/Algiers Africa/Asmara Africa/Asmera Africa/Bamako Africa/Bangui Africa/Banjul Africa/Bissau and so on .... Java TimeZone class Example: getOffset()Test it NowOutput: The Offset value of TimeZone: 19800000 Java TimeZone class Example: getID()Test it NowOutput: Value of ID is: Asia/Kolkata Java TimeZone class Example: getDisplayName()Test it NowOutput: Display name for default time zone: India Standard Time
Next TopicJava DateFormat
|