Package org.apache.iceberg.util
Class DateTimeUtil
- java.lang.Object
-
- org.apache.iceberg.util.DateTimeUtil
-
public class DateTimeUtil extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description static java.time.OffsetDateTime
EPOCH
static java.time.LocalDate
EPOCH_DAY
static long
MICROS_PER_MILLIS
static long
MICROS_PER_SECOND
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.time.LocalDate
dateFromDays(int daysFromEpoch)
static int
daysFromDate(java.time.LocalDate date)
static int
daysFromInstant(java.time.Instant instant)
static java.lang.String
daysToIsoDate(int days)
static int
daysToMonths(int days)
static int
daysToYears(int days)
static java.lang.String
formatTimestampMillis(long millis)
static int
isoDateToDays(java.lang.String dateString)
static long
isoTimestampToMicros(java.lang.String timestampString)
static long
isoTimestampToNanos(java.lang.CharSequence timestampString)
static long
isoTimestamptzToMicros(java.lang.String timestampString)
static long
isoTimestamptzToNanos(java.lang.CharSequence timestampString)
static long
isoTimeToMicros(java.lang.String timeString)
static boolean
isUTCTimestamptz(java.lang.String timestampString)
static long
microsFromInstant(java.time.Instant instant)
static long
microsFromTime(java.time.LocalTime time)
static long
microsFromTimestamp(java.time.LocalDateTime dateTime)
static long
microsFromTimestamptz(java.time.OffsetDateTime dateTime)
static int
microsToDays(long micros)
static int
microsToHours(long micros)
static java.lang.String
microsToIsoTime(long micros)
static java.lang.String
microsToIsoTimestamp(long micros)
static java.lang.String
microsToIsoTimestamptz(long micros)
static long
microsToMillis(long micros)
static int
microsToMonths(long micros)
static long
microsToNanos(long micros)
static int
microsToYears(long micros)
static long
nanosFromTimestamp(java.time.LocalDateTime dateTime)
static long
nanosFromTimestamptz(java.time.OffsetDateTime dateTime)
static int
nanosToDays(long nanos)
static int
nanosToHours(long nanos)
static java.lang.String
nanosToIsoTimestamp(long nanos)
static java.lang.String
nanosToIsoTimestamptz(long nanos)
static long
nanosToMicros(long nanos)
static int
nanosToMonths(long nanos)
static int
nanosToYears(long nanos)
static java.time.LocalTime
timeFromMicros(long microFromMidnight)
static java.time.LocalDateTime
timestampFromMicros(long microsFromEpoch)
static java.time.LocalDateTime
timestampFromNanos(long nanosFromEpoch)
static java.time.OffsetDateTime
timestamptzFromMicros(long microsFromEpoch)
-
-
-
Field Detail
-
EPOCH
public static final java.time.OffsetDateTime EPOCH
-
EPOCH_DAY
public static final java.time.LocalDate EPOCH_DAY
-
MICROS_PER_MILLIS
public static final long MICROS_PER_MILLIS
- See Also:
- Constant Field Values
-
MICROS_PER_SECOND
public static final long MICROS_PER_SECOND
- See Also:
- Constant Field Values
-
-
Method Detail
-
dateFromDays
public static java.time.LocalDate dateFromDays(int daysFromEpoch)
-
daysFromDate
public static int daysFromDate(java.time.LocalDate date)
-
daysFromInstant
public static int daysFromInstant(java.time.Instant instant)
-
timeFromMicros
public static java.time.LocalTime timeFromMicros(long microFromMidnight)
-
microsFromTime
public static long microsFromTime(java.time.LocalTime time)
-
timestampFromMicros
public static java.time.LocalDateTime timestampFromMicros(long microsFromEpoch)
-
timestampFromNanos
public static java.time.LocalDateTime timestampFromNanos(long nanosFromEpoch)
-
microsFromInstant
public static long microsFromInstant(java.time.Instant instant)
-
microsFromTimestamp
public static long microsFromTimestamp(java.time.LocalDateTime dateTime)
-
nanosFromTimestamp
public static long nanosFromTimestamp(java.time.LocalDateTime dateTime)
-
microsToMillis
public static long microsToMillis(long micros)
-
nanosToMicros
public static long nanosToMicros(long nanos)
-
microsToNanos
public static long microsToNanos(long micros)
-
timestamptzFromMicros
public static java.time.OffsetDateTime timestamptzFromMicros(long microsFromEpoch)
-
microsFromTimestamptz
public static long microsFromTimestamptz(java.time.OffsetDateTime dateTime)
-
nanosFromTimestamptz
public static long nanosFromTimestamptz(java.time.OffsetDateTime dateTime)
-
formatTimestampMillis
public static java.lang.String formatTimestampMillis(long millis)
-
daysToIsoDate
public static java.lang.String daysToIsoDate(int days)
-
microsToIsoTime
public static java.lang.String microsToIsoTime(long micros)
-
microsToIsoTimestamptz
public static java.lang.String microsToIsoTimestamptz(long micros)
-
nanosToIsoTimestamptz
public static java.lang.String nanosToIsoTimestamptz(long nanos)
-
microsToIsoTimestamp
public static java.lang.String microsToIsoTimestamp(long micros)
-
nanosToIsoTimestamp
public static java.lang.String nanosToIsoTimestamp(long nanos)
-
isoDateToDays
public static int isoDateToDays(java.lang.String dateString)
-
isoTimeToMicros
public static long isoTimeToMicros(java.lang.String timeString)
-
isoTimestamptzToMicros
public static long isoTimestamptzToMicros(java.lang.String timestampString)
-
isoTimestamptzToNanos
public static long isoTimestamptzToNanos(java.lang.CharSequence timestampString)
-
isUTCTimestamptz
public static boolean isUTCTimestamptz(java.lang.String timestampString)
-
isoTimestampToMicros
public static long isoTimestampToMicros(java.lang.String timestampString)
-
isoTimestampToNanos
public static long isoTimestampToNanos(java.lang.CharSequence timestampString)
-
daysToYears
public static int daysToYears(int days)
-
daysToMonths
public static int daysToMonths(int days)
-
microsToYears
public static int microsToYears(long micros)
-
microsToMonths
public static int microsToMonths(long micros)
-
microsToDays
public static int microsToDays(long micros)
-
microsToHours
public static int microsToHours(long micros)
-
nanosToYears
public static int nanosToYears(long nanos)
-
nanosToMonths
public static int nanosToMonths(long nanos)
-
nanosToDays
public static int nanosToDays(long nanos)
-
nanosToHours
public static int nanosToHours(long nanos)
-
-