TimeZone represents a time zone offset, and also figures out daylight savings(Daylight saving time (DST) or summer time is the practice of advancing clocks during the summer months that have more sunlight so that people get up later in the morning and go to bed later at night. Typically clocks are adjusted forward one hour near the start of spring and are adjusted backward in the autumn).
Creating TimeZone instance :
Creating TimeZone with a time zone ID :
Hours must be between 0 to 23 and Minutes must be between 00 to 59. For example, "GMT+10" and "GMT+0010" mean ten hours and ten minutes ahead of GMT, respectively.
GMT Sign Hours : Minutes
GMT Sign Hours Minutes
GMT Sign Hours
When creating a TimeZone, the specified custom time zone ID is normalized in the following syntax:
GMT Sign TwoDigitHours : MinutesFor example, TimeZone.getTimeZone("GMT-8").getID() returns "GMT-08:00".
TimeZone have only one constructor.
This constructor is the single constructor for invocation by subclass
India Standard Time
In the above program we have created a calendar instance at LINE A and a TimeZone instance with India Standard Time zone. At LINE C we dislplayed the name of the time zone using
THINGS TO TRY