SimpleTimeZone setRawOffset() method in Java with Examples
Last Updated :
08 Aug, 2022
The setRawOffset() method of SimpleTimeZone class is used to set the base time zone offset to GMT. The offset is added to UTC to get the local time.
Syntax:
public void setRawOffset(int offsetMillis)
Parameters: The function accepts a single parameter offsetMillis which specifies the given base time zone offset to GMT.
Return Value: The method has no return value.
Exception: The function does not throws any exception.
Program below demonstrates the above mentioned function:
Program 1:
Output:
Initially RawOffset is = 500
RawOffset set to 6000000
Current RawOffset is = 6000000
Program 2:
Output:
Initially RawOffset is = 800
RawOffset set to 8000000
Current RawOffset is = 8000000
Like Article
Suggest improvement
Share your thoughts in the comments
Please Login to comment...