com.taosdata.jdbc.utils

## Class DateTimeUtils

- java.lang.Object
- - com.taosdata.jdbc.utils.DateTimeUtils

    public class DateTimeUtils
    extends Object

### Method Summary

All Methods Static Methods Concrete Methods
`static Date` `getDate(Instant instant, ZoneId zoneId)`
`static LocalDateTime` `getLocalDateTime(Instant instant, ZoneId zoneId)`
`static OffsetDateTime` `getOffsetDateTime(Instant instant, ZoneId zoneId)`
`static Time` `getTime(Instant instant, ZoneId zoneId)`
`static Timestamp` `getTimestamp(Instant instant, ZoneId zoneId)`
`static ZonedDateTime` `getZonedDateTime(Instant instant, ZoneId zoneId)`
`static Date` `parseDate(String timestampStr, ZoneId zoneId)`
`static Time` `parseTime(String timestampStr, ZoneId zoneId)`
`static Timestamp` `parseTimestamp(String timeStampStr, ZoneId zoneId)`
`static Instant` `parseTimestampColumnData(long value, int timestampPrecision)`
`static Instant` `toInstant(Timestamp timestamp, Calendar cal)`
`static Instant` `toInstant(Timestamp timestamp, ZoneId zoneId)`
`static Long` `toLong(Instant instant, int precision)`
`static Long` `toLong(LocalDateTime localDateTime, ZoneId zoneId, int precision)`
`static Long` `toLong(OffsetDateTime offsetDateTime, int precision)`
`static Long` `toLong(Timestamp timestamp, ZoneId zoneId, int precision)`
`static Long` `toLong(ZonedDateTime zonedDateTime, int precision)`

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

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

### Method Detail

#### parseTime

    public static Time parseTime(String timestampStr,
                                 ZoneId zoneId)
                          throws DateTimeParseException

Throws:
  `DateTimeParseException`

#### parseDate

    public static Date parseDate(String timestampStr,
                                 ZoneId zoneId)

#### parseTimestamp

    public static Timestamp parseTimestamp(String timeStampStr,
                                           ZoneId zoneId)

#### toInstant

    public static Instant toInstant(Timestamp timestamp,
                                    ZoneId zoneId)

#### toInstant

    public static Instant toInstant(Timestamp timestamp,
                                    Calendar cal)

#### toLong

    public static Long toLong(Instant instant,
                              int precision)

#### toLong

    public static Long toLong(Timestamp timestamp,
                              ZoneId zoneId,
                              int precision)

#### toLong

    public static Long toLong(LocalDateTime localDateTime,
                              ZoneId zoneId,
                              int precision)

#### toLong

    public static Long toLong(ZonedDateTime zonedDateTime,
                              int precision)

#### toLong

    public static Long toLong(OffsetDateTime offsetDateTime,
                              int precision)

#### parseTimestampColumnData

    public static Instant parseTimestampColumnData(long value,
                                                   int timestampPrecision)

#### getTimestamp

    public static Timestamp getTimestamp(Instant instant,
                                         ZoneId zoneId)

#### getLocalDateTime

    public static LocalDateTime getLocalDateTime(Instant instant,
                                                 ZoneId zoneId)

#### getOffsetDateTime

    public static OffsetDateTime getOffsetDateTime(Instant instant,
                                                   ZoneId zoneId)

#### getZonedDateTime

    public static ZonedDateTime getZonedDateTime(Instant instant,
                                                 ZoneId zoneId)

#### getDate

    public static Date getDate(Instant instant,
                               ZoneId zoneId)

#### getTime

    public static Time getTime(Instant instant,
                               ZoneId zoneId)