TimestampUtils (Hive Storage API 2.1.1-pre-orc API)
Date: 2016-10-19

org.apache.hadoop.hive.ql.util

## Class TimestampUtils

- java.lang.Object
- - org.apache.hadoop.hive.ql.util.TimestampUtils

-     public class TimestampUtils
      extends Object

  Utitilities for Timestamps and the relevant conversions.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static BigDecimal` | `BILLION_BIG_DECIMAL`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `TimestampUtils()`

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static Timestamp` | `decimalToTimestamp(HiveDecimal d)`
    `static Timestamp` | `doubleToTimestamp(double f)`
    `static double` | `getDouble(Timestamp ts)` Convert the timestamp to a double measured in seconds.
    `static long` | `millisToSeconds(long millis)` Rounds the number of milliseconds relative to the epoch down to the nearest whole number of seconds.

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

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

- - ### Field Detail

    - #### BILLION_BIG_DECIMAL

          public static final BigDecimal BILLION_BIG_DECIMAL

  - ### Constructor Detail

    - #### TimestampUtils

          public TimestampUtils()

  - ### Method Detail

    - #### getDouble

          public static double getDouble(Timestamp ts)

      Convert the timestamp to a double measured in seconds.
      Returns:
        double representation of the timestamp, accurate to nanoseconds

    - #### doubleToTimestamp

          public static Timestamp doubleToTimestamp(double f)

    - #### decimalToTimestamp

          public static Timestamp decimalToTimestamp(HiveDecimal d)

    - #### millisToSeconds

          public static long millisToSeconds(long millis)

      Rounds the number of milliseconds relative to the epoch down to the nearest whole number of seconds. 500 would round to 0, -500 would round to -1.

Copyright © 2016 The Apache Software Foundation. All rights reserved.