Java Date Time - Java Calendar ZONE_OFFSET








Syntax

Calendar.ZONE_OFFSET has the following syntax.

public static final int ZONE_OFFSET

Example

In the following code shows how to use Calendar.ZONE_OFFSET field.

import java.util.Calendar;
import java.util.GregorianCalendar;
/*from www  .j a  v  a 2 s.  c  o m*/
public class Main {

  public static void main(String[] args) {

    Calendar cal = new GregorianCalendar();   
    System.out.println(cal.get(Calendar.ZONE_OFFSET));
    
    
  }
}

The code above generates the following result.