java.util.TimeZone.getRawOffset() Method


Advertisements


Description

The getRawOffset() method is used to get the amount of time in milliseconds to add to UTC to get standard time in this time zone.

Declaration

Following is the declaration for java.util.TimeZone.getRawOffset() method.

public abstract int getRawOffset()

Parameters

NA

Return Value

The method call returns the amount of raw offset time in milliseconds to add to UTC.

Exception

NA

Example

The following example shows the usage of java.util.TimeZone.getRawOffset()

Live Demo
package com.tutorialspoint;

import java.util.*;

public class TimeZoneDemo {
   public static void main( String args[] ) {

      // create time zone object     
      TimeZone timezone = TimeZone.getDefault();

      // checking raw offset value     
      System.out.println("Raw Offset value:" + timezone.getRawOffset());
   }    
}

Let us compile and run the above program, this will produce the following result.

Raw Offset value:19800000

java_util_timezone.htm

Advertisements