The setRawOffset(int offsetMillis) method of TimeZone class in Java is used to set the base time zone offset to GMT. This offset value can be to UTC to get the local time.
public abstract void setRawOffset(int offsetMillis)
Parameters: The method accepts a single parameter offsetMillis of Integer type which specifies the given base time zone offset to GMT.
Return Value: The method does not return any value.
Below program illustrates the above-mentioned function:
Initially RawOffset is = -39600000 RawOffset set to 6000000 Current RawOffset is = 6000000
Inittally RawOffset is = 3600000 RawOffset set to 8000000 Current RawOffset is = 8000000
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. To complete your preparation from learning a language to DS Algo and many more, please refer Complete Interview Preparation Course.