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
isoTimestamptzToMicros(java.lang.String 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 int
microsToYears(long micros)
static java.time.LocalTime
timeFromMicros(long microFromMidnight)
static java.time.LocalDateTime
timestampFromMicros(long microsFromEpoch)
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)
-
microsFromInstant
public static long microsFromInstant(java.time.Instant instant)
-
microsFromTimestamp
public static long microsFromTimestamp(java.time.LocalDateTime dateTime)
-
microsToMillis
public static long microsToMillis(long micros)
-
timestamptzFromMicros
public static java.time.OffsetDateTime timestamptzFromMicros(long microsFromEpoch)
-
microsFromTimestamptz
public static long microsFromTimestamptz(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)
-
microsToIsoTimestamp
public static java.lang.String microsToIsoTimestamp(long micros)
-
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)
-
isUTCTimestamptz
public static boolean isUTCTimestamptz(java.lang.String timestampString)
-
isoTimestampToMicros
public static long isoTimestampToMicros(java.lang.String 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)
-
-