java.util.SimpleTimeZone.getOffset() 方法


java.util.SimpleTimeZone.getOffset() 方法

package com.codingdict;

import java.util.*;

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

      // create simple time zone object
      SimpleTimeZone stobj = new SimpleTimeZone(720,"US");

      // get offset
      int offset = stobj.getOffset(GregorianCalendar.AD, 2000, 10, 2, 4, 5000);

      // check offset value       
      System.out.println("Offset is : " + offset);
   }    
}