com.amazon.redshift.util

## Class RedshiftTime

- java.lang.Object
- - java.util.Date
  - - java.sql.Time
    - - com.amazon.redshift.util.RedshiftTime

All Implemented Interfaces:
  Serializable, Cloneable, Comparable<Date>

    public class RedshiftTime
    extends Time

This class augments the Java built-in Time to allow for explicit setting of the time zone.

See Also:
  Serialized Form

### Constructor Summary

Constructors
Constructor and Description
`RedshiftTime(long time)` Constructs a `RedshiftTime` without a time zone.
`RedshiftTime(long time, Calendar calendar)` Constructs a `RedshiftTime` with the given calendar object.

### Method Summary

All Methods Instance Methods Concrete Methods
`Object` `clone()`
`boolean` `equals(Object obj)`
`Calendar` `getCalendar()` Returns the calendar object for this time.
`int` `hashCode()`
`void` `setCalendar(Calendar calendar)` Sets the calendar object for this time.

### Methods inherited from class java.sql.Time

`getDate, getDay, getMonth, getYear, setDate, setMonth, setTime, setYear, toInstant, toLocalTime, toString, valueOf, valueOf`

### Methods inherited from class java.util.Date

`after, before, compareTo, from, getHours, getMinutes, getSeconds, getTime, getTimezoneOffset, parse, setHours, setMinutes, setSeconds, toGMTString, toLocaleString, UTC`

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

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

### Constructor Detail

#### RedshiftTime

    public RedshiftTime(long time)

Constructs a `RedshiftTime` without a time zone.

Parameters:
  `time` - milliseconds since January 1, 1970, 00:00:00 GMT; a negative number is milliseconds before January 1, 1970, 00:00:00 GMT.
See Also:
  `Time.Time(long)`

#### RedshiftTime

    public RedshiftTime(long time,
                        Calendar calendar)

Constructs a `RedshiftTime` with the given calendar object. The calendar object is optional. If absent, the driver will treat the time as `time without time zone`. When present, the driver will treat the time as a `time with time zone` using the `TimeZone` in the calendar object. Furthermore, this calendar will be used instead of the calendar object passed to `PreparedStatement.setTime(int, Time, Calendar)`.

Parameters:
  `time` - milliseconds since January 1, 1970, 00:00:00 GMT; a negative number is milliseconds before January 1, 1970, 00:00:00 GMT.
  `calendar` - the calendar object containing the time zone or `null`.
See Also:
  `Time.Time(long)`

### Method Detail

#### setCalendar

    public void setCalendar(Calendar calendar)

Sets the calendar object for this time.

Parameters:
  `calendar` - the calendar object or `null`.

#### getCalendar

    public Calendar getCalendar()

Returns the calendar object for this time.

Returns:
  the calendar or `null`.

#### hashCode

    public int hashCode()

Overrides:
  `hashCode` in class `Date`

#### equals

    public boolean equals(Object obj)

Overrides:
  `equals` in class `Date`

#### clone

    public Object clone()

Overrides:
  `clone` in class `Date`