The getID() method of TimeZone class in Java is used to get official ID of a particular TimeZone.
public String getID()
Parameters: The method does not take any parameters.
Return Value: The method returns the ID of the TimeZone.
Below programs illustrate the working of getID() Method of TimeZone:
The ID is: Pacific/Pago_Pago
The ID is: Europe/Rome
Attention reader! Don’t stop learning now. Get hold of all the important Java Foundation and Collections concepts with the Fundamentals of Java and Java Collections Course at a student-friendly price and become industry ready.