Package org.duckdb

# Class DuckDBTimestamp

java.lang.Object
org.duckdb.DuckDBTimestamp

Direct Known Subclasses:
  `DuckDBTime`, `DuckDBTimestampTZ`

public class DuckDBTimestamp extends Object

## Field Summary

Fields
Modifier and Type
Field
Description
`protected long`
`timeMicros`

## Constructor Summary

Constructors
Constructor
Description
`DuckDBTimestamp(long timeMicros)`
`DuckDBTimestamp(Timestamp sqlTimestamp)`
`DuckDBTimestamp(LocalDateTime localDateTime)`
`DuckDBTimestamp(OffsetDateTime offsetDateTime)`

## Method Summary

Modifier and Type
Method
Description
`static long`
`getMicroseconds(Timestamp sqlTimestamp)`
`long`
`getMicrosEpoch()`
`static long`
`localDateTime2Micros(LocalDateTime localDateTime)`
`static LocalDateTime`
`localDateTimeFromTimestamp(long value, ChronoUnit unit, ZoneId zoneIdNullable)`
`static LocalDateTime`
`localDateTimeFromTimestampWithTimezone(long value, ChronoUnit unit, ZoneId zoneIdNullable)`
`LocalDateTime`
`toLocalDateTime()`
`OffsetDateTime`
`toOffsetDateTime()`
`static OffsetTime`
`toOffsetTime(long timeBits)`
`Timestamp`
`toSqlTimestamp()`
`String`
`toString()`
`static Object`
`valueOf(Object x)`

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

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

## Field Details

### timeMicros

protected long timeMicros

## Constructor Details

### DuckDBTimestamp

public DuckDBTimestamp(long timeMicros)

### DuckDBTimestamp

public DuckDBTimestamp(LocalDateTime localDateTime)

### DuckDBTimestamp

public DuckDBTimestamp(OffsetDateTime offsetDateTime)

### DuckDBTimestamp

public DuckDBTimestamp(Timestamp sqlTimestamp)

## Method Details

### localDateTimeFromTimestampWithTimezone

public static LocalDateTime localDateTimeFromTimestampWithTimezone(long value, ChronoUnit unit, ZoneId zoneIdNullable) throws SQLException

Throws:
  `SQLException`

### localDateTimeFromTimestamp

public static LocalDateTime localDateTimeFromTimestamp(long value, ChronoUnit unit, ZoneId zoneIdNullable) throws SQLException

Throws:
  `SQLException`

### toOffsetTime

public static OffsetTime toOffsetTime(long timeBits)

### localDateTime2Micros

public static long localDateTime2Micros(LocalDateTime localDateTime)

### valueOf

public static Object valueOf(Object x)

### toSqlTimestamp

public Timestamp toSqlTimestamp()

### toLocalDateTime

public LocalDateTime toLocalDateTime()

### toOffsetDateTime

public OffsetDateTime toOffsetDateTime()

### getMicroseconds

public static long getMicroseconds(Timestamp sqlTimestamp)

### getMicrosEpoch

public long getMicrosEpoch()

### toString

public String toString()

Overrides:
  `toString` in class `Object`