TimeZone getDefault() Method in Java with Examples Last Updated : 02 Jan, 2019 Summarize Comments Improve Suggest changes Share Like Article Like Report The getDefault() method of TimeZone class in Java is used to know the default TimeZone for this system or host. This may vary in according to the implementation in different environment. Syntax: public static TimeZone getDefault() Parameters: The method does not take any parameters. Return Value: The method returns the default TimeZone of the host. Below program illustrates the working of getDefault() Method of TimeZone: Java // Java code to illustrate getDefault() method import java.util.*; public class TimeZoneDemo { public static void main(String args[]) { // Creating an object of TimeZone class. TimeZone time_zone_default = TimeZone.getDefault(); // Displaying the default TimeZone System.out.println("Default TimeZone: " + time_zone_default); } } Output: Default TimeZone: sun.util.calendar.ZoneInfo[id="Etc/UTC", offset=0, dstSavings=0, useDaylight=false, transitions=0, lastRule=null] Comment More infoAdvertise with us Next Article Period get() method in Java with Examples C chinmoy lenka Follow Improve Article Tags : Java Java - util package Java-Functions Java-TimeZone Practice Tags : Java Similar Reads TimeZone getDSTSavings() Method in Java with Examples The getDSTSavings() method of TimeZone class in Java is used to know the amount of time needed to be added to local standard time to get the wall clock time. Syntax: public int getDSTSavings() Parameters: The method does not take any parameters. Return Value: The method returns in milliseconds the a 1 min read SimpleTimeZone getDSTSavings() method in Java with Examples The getDSTSavings() method of SimpleTimeZone class returns the amount of time (in milliseconds) that the clock advances during daylight saving time. Syntax: public int getDSTSavings() Parameters: The function does not accepts any parameter. Return Value: The method returns the time is advanced with 1 min read OffsetTime get() method in Java with examples The get() method of OffsetTime class in Java gets the value of the specified field from this time as an int. Syntax : public int get(TemporalField field) Parameter : This method accepts a parameter field which specifies the field to get, not null.Return Value: It returns the value for the field.Exce 2 min read Period get() method in Java with Examples The get() method of Period class in Java is used to get the value of the requested unit(YEARS, MONTHS or DAYS) given in the argument from this Period. Syntax: public long get(TemporalUnit unit) Parameters: This method accepts a single parameter unit of type TemporalUnit which is the unit to get requ 2 min read OffsetTime getHour() method in Java with examples The getHour() method of OffsetTime class in Java is used to get the value of the hour-of-day field from this OffsetTime instance. Syntax : public int getHour() Parameter : This method does not accepts any parameter. Return Value: It returns the hour-of-day which ranges from 0 to 23. Below programs i 1 min read OffsetTime getMinute() method in Java with examples The getMinute() method of OffsetTime class in Java is used to get the value of the minute field from this OffsetTime instance. Syntax : public int getMinute() Parameter : This method accepts does not accepts any parameters. Return Value: It returns the minute-of-hour which in range from 0 to 59. Bel 1 min read Like