Example usage for java.util SimpleTimeZone getOffset

List of usage examples for java.util SimpleTimeZone getOffset

Introduction

In this page you can find the example usage for java.util SimpleTimeZone getOffset.

Prototype

public int getOffset(int era, int year, int month, int day, int dayOfWeek, int millis) 

Source Link

Document

Returns the difference in milliseconds between local time and UTC, taking into account both the raw offset and the effect of daylight saving, for the specified date and time.

Usage

From source file:Main.java

public static void main(String args[]) {

    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);
}