Example usage for java.sql Date getTimezoneOffset

List of usage examples for java.sql Date getTimezoneOffset

Introduction

In this page you can find the example usage for java.sql Date getTimezoneOffset.

Prototype

@Deprecated
public int getTimezoneOffset() 

Source Link

Document

Returns the offset, measured in minutes, for the local time zone relative to UTC that is appropriate for the time represented by this Date object.

Usage

From source file:org.siphon.jssql.SqlExecutor.java

private Timestamp dateToTimeStamp(java.util.Date date) {
    if (this.isPostgreSQL()) {
        return new java.sql.Timestamp(date.getTime() + date.getTimezoneOffset() * 60000);
    } else {/*from w w w .j a v  a  2s  .  c  o m*/
        return new java.sql.Timestamp(date.getTime());
    }
}