DateUtils (ORC Core 1.6.6 API)
Date: 2021-01-13

org.apache.orc.impl

## Class DateUtils

- java.lang.Object
- - org.apache.orc.impl.DateUtils

-     public class DateUtils
      extends Object

  Conversion utilities from the hybrid Julian/Gregorian calendar to/from the proleptic Gregorian. The semantics here are to hold the string representation constant and change the epoch offset rather than holding the instant in time constant and change the string representation. These utilities will be fast for the common case (> 1582 AD), but slow for old dates.

- - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static int` | `convertDate(int original, boolean fromProleptic, boolean toProleptic)`
    `static int` | `convertDateToHybrid(int proleptic)` Convert an epoch day from the proleptic Gregorian calendar to the hybrid Julian/Gregorian.
    `static int` | `convertDateToProleptic(int hybrid)` Convert an epoch day from the hybrid Julian/Gregorian calendar to the proleptic Gregorian.
    `static long` | `convertTime(long original, boolean fromProleptic, boolean toProleptic, boolean useUtc)`
    `static long` | `convertTimeToHybrid(long proleptic, boolean useUtc)` Convert epoch millis from the proleptic Gregorian calendar to the hybrid Julian/Gregorian.
    `static long` | `convertTimeToProleptic(long hybrid, boolean useUtc)` Convert epoch millis from the hybrid Julian/Gregorian calendar to the proleptic Gregorian.
    `static DateTimeFormatter` | `getTimeFormat(boolean useProleptic, boolean useUtc)`
    `static Integer` | `parseDate(String date, boolean fromProleptic)`
    `static Long` | `parseTime(String date, boolean fromProleptic, boolean useUtc)`
    `static String` | `printDate(int date, boolean fromProleptic)`
    `static String` | `printTime(long millis, boolean fromProleptic, boolean useUtc)`

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

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

- - ### Method Detail

    - #### convertDateToProleptic

          public static int convertDateToProleptic(int hybrid)

      Convert an epoch day from the hybrid Julian/Gregorian calendar to the proleptic Gregorian.
      Parameters:
        `hybrid` - day of epoch in the hybrid Julian/Gregorian
      Returns:
        day of epoch in the proleptic Gregorian

    - #### convertDateToHybrid

          public static int convertDateToHybrid(int proleptic)

      Convert an epoch day from the proleptic Gregorian calendar to the hybrid Julian/Gregorian.
      Parameters:
        `proleptic` - day of epoch in the proleptic Gregorian
      Returns:
        day of epoch in the hybrid Julian/Gregorian

    - #### convertTimeToProleptic

          public static long convertTimeToProleptic(long hybrid,
                                                    boolean useUtc)

      Convert epoch millis from the hybrid Julian/Gregorian calendar to the proleptic Gregorian.
      Parameters:
        `hybrid` - millis of epoch in the hybrid Julian/Gregorian
        `useUtc` - use UTC instead of local
      Returns:
        millis of epoch in the proleptic Gregorian

    - #### convertTimeToHybrid

          public static long convertTimeToHybrid(long proleptic,
                                                 boolean useUtc)

      Convert epoch millis from the proleptic Gregorian calendar to the hybrid Julian/Gregorian.
      Parameters:
        `proleptic` - millis of epoch in the proleptic Gregorian
        `useUtc` - use UTC instead of local
      Returns:
        millis of epoch in the hybrid Julian/Gregorian

    - #### convertDate

          public static int convertDate(int original,
                                        boolean fromProleptic,
                                        boolean toProleptic)

    - #### convertTime

          public static long convertTime(long original,
                                         boolean fromProleptic,
                                         boolean toProleptic,
                                         boolean useUtc)

    - #### parseDate

          public static Integer parseDate(String date,
                                          boolean fromProleptic)

    - #### printDate

          public static String printDate(int date,
                                         boolean fromProleptic)

    - #### getTimeFormat

          public static DateTimeFormatter getTimeFormat(boolean useProleptic,
                                                        boolean useUtc)

    - #### parseTime

          public static Long parseTime(String date,
                                       boolean fromProleptic,
                                       boolean useUtc)

    - #### printTime

          public static String printTime(long millis,
                                         boolean fromProleptic,
                                         boolean useUtc)

Copyright © 2013–2021 The Apache Software Foundation. All rights reserved.