GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||||||||||||||||
GeezerVison is showing www.tutorialspoint.com — Java TimeZone Class
Selected Reading
Java TimeZone ClassIntroductionThe Java TimeZone class represents a time zone offset, and also figures out daylight savings.Following are the important points about TimeZone −
Class declarationFollowing is the declaration for java.util.TimeZone class − public abstract class TimeZone extends Object implements Serializable, Cloneable FieldFollowing are the fields for java.util.TimeZone class −
Class constructors
Class methods
Methods inheritedThis class inherits methods from the following classes −
Getting Default Timezone for the Current Host ExampleThe following example shows the usage of Java TimeZone getDefault() method to get the default TimeZone object for this host. We've created a TimeZone using getDefault() method and then printed it. package com.tutorialspoint;
import java.util.TimeZone;
public class TimeZoneDemo {
public static void main( String args[] ) {
// create default time zone object
TimeZone timezonedefault = TimeZone.getDefault();
// checking default time zone value
System.out.println("Default time zone is :\n" + timezonedefault);
}
}
OutputLet us compile and run the above program, this will produce the following result. Default time zone is : sun.util.calendar.ZoneInfo[id="Asia/Calcutta",offset=19800000,dstSavings=0,useDaylight=false,transitions=7,lastRule=null] Advertisements
| ||||||||||||||||||||||||||||||||||||||
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |