org.h2.api

## Class TimestampWithTimeZone

- java.lang.Object
- - org.h2.api.TimestampWithTimeZone

All Implemented Interfaces:
  java.io.Serializable, java.lang.Cloneable

    public class TimestampWithTimeZone
    extends java.lang.Object
    implements java.io.Serializable, java.lang.Cloneable

How we expose "TIMESTAMP WITH TIMEZONE" in our ResultSets.

See Also:
  Serialized Form

### Constructor Summary

Constructors
Constructor and Description
`TimestampWithTimeZone(long dateValue, long timeNanos, short timeZoneOffsetMins)`

### Method Summary

Methods
`boolean` `equals(java.lang.Object obj)`
`int` `getDay()` Gets the day of month 1-based.
`int` `getMonth()` Gets the month 1-based.
`long` `getNanosSinceMidnight()` Gets the nanoseconds since midnight.
`short` `getTimeZoneOffsetMins()` The time zone offset in minutes.
`int` `getYear()` Gets the year.
`long` `getYMD()`
`int` `hashCode()`
`java.lang.String` `toString()`

### Methods inherited from class java.lang.Object

`clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

### Constructor Detail

#### TimestampWithTimeZone

    public TimestampWithTimeZone(long dateValue,
                         long timeNanos,
                         short timeZoneOffsetMins)

### Method Detail

#### getYMD

    public long getYMD()

Returns:
  the year-month-day bit field

#### getYear

    public int getYear()

Gets the year.

The year is in the specified time zone and not UTC. So for `2015-12-31 19:00:00.00-10:00` the value returned will be `2015` even though in UTC the year is `2016`.

Returns:
  the year

#### getMonth

    public int getMonth()

Gets the month 1-based.

The month is in the specified time zone and not UTC. So for `2015-12-31 19:00:00.00-10:00` the value returned is `12` even though in UTC the month is `1`.

Returns:
  the month

#### getDay

    public int getDay()

Gets the day of month 1-based.

The day of month is in the specified time zone and not UTC. So for `2015-12-31 19:00:00.00-10:00` the value returned is `31` even though in UTC the day of month is `1`.

Returns:
  the day of month

#### getNanosSinceMidnight

    public long getNanosSinceMidnight()

Gets the nanoseconds since midnight.

The nanoseconds are relative to midnight in the specified time zone. So for `2016-09-24 00:00:00.000000001-00:01` the value returned is `1` even though `60000000001` nanoseconds have passed since midnight in UTC.

Returns:
  the nanoseconds since midnight

#### getTimeZoneOffsetMins

    public short getTimeZoneOffsetMins()

The time zone offset in minutes.

Returns:
  the offset

#### toString

    public java.lang.String toString()

Overrides:
  `toString` in class `java.lang.Object`

#### hashCode

    public int hashCode()

Overrides:
  `hashCode` in class `java.lang.Object`

#### equals

    public boolean equals(java.lang.Object obj)

Overrides:
  `equals` in class `java.lang.Object`