Package org.apache.iceberg.util
Class DateTimeUtil
java.lang.Object
org.apache.iceberg.util.DateTimeUtil
-
Field Summary
Modifier and TypeFieldDescriptionstatic final OffsetDateTime
static final LocalDate
static final long
static final long
-
Method Summary
Modifier and TypeMethodDescriptionstatic LocalDate
dateFromDays
(int daysFromEpoch) static int
daysFromDate
(LocalDate date) static int
daysFromInstant
(Instant instant) static String
daysToIsoDate
(int days) static int
daysToMonths
(int days) static int
daysToYears
(int days) static String
formatTimestampMillis
(long millis) static int
isoDateToDays
(String dateString) static long
isoTimestampToMicros
(String timestampString) static long
isoTimestampToNanos
(CharSequence timestampString) static long
isoTimestamptzToMicros
(String timestampString) static long
isoTimestamptzToNanos
(CharSequence timestampString) static long
isoTimeToMicros
(String timeString) static boolean
isUTCTimestamptz
(String timestampString) static long
microsFromInstant
(Instant instant) static long
microsFromTime
(LocalTime time) static long
microsFromTimestamp
(LocalDateTime dateTime) static long
microsFromTimestamptz
(OffsetDateTime dateTime) static int
microsToDays
(long micros) static int
microsToHours
(long micros) static String
microsToIsoTime
(long micros) static String
microsToIsoTimestamp
(long micros) static 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
(LocalDateTime dateTime) static long
nanosFromTimestamptz
(OffsetDateTime dateTime) static int
nanosToDays
(long nanos) static int
nanosToHours
(long nanos) static String
nanosToIsoTimestamp
(long nanos) static String
nanosToIsoTimestamptz
(long nanos) static long
nanosToMicros
(long nanos) static int
nanosToMonths
(long nanos) static int
nanosToYears
(long nanos) static LocalTime
timeFromMicros
(long microFromMidnight) static LocalDateTime
timestampFromMicros
(long microsFromEpoch) static LocalDateTime
timestampFromNanos
(long nanosFromEpoch) static OffsetDateTime
timestamptzFromMicros
(long microsFromEpoch)
-
Field Details
-
EPOCH
-
EPOCH_DAY
-
MICROS_PER_MILLIS
public static final long MICROS_PER_MILLIS- See Also:
-
MICROS_PER_SECOND
public static final long MICROS_PER_SECOND- See Also:
-
-
Method Details
-
dateFromDays
-
daysFromDate
-
daysFromInstant
-
timeFromMicros
-
microsFromTime
-
timestampFromMicros
-
timestampFromNanos
-
microsFromInstant
-
microsFromTimestamp
-
nanosFromTimestamp
-
microsToMillis
public static long microsToMillis(long micros) -
nanosToMicros
public static long nanosToMicros(long nanos) -
microsToNanos
public static long microsToNanos(long micros) -
timestamptzFromMicros
-
microsFromTimestamptz
-
nanosFromTimestamptz
-
formatTimestampMillis
-
daysToIsoDate
-
microsToIsoTime
-
microsToIsoTimestamptz
-
nanosToIsoTimestamptz
-
microsToIsoTimestamp
-
nanosToIsoTimestamp
-
isoDateToDays
-
isoTimeToMicros
-
isoTimestamptzToMicros
-
isoTimestamptzToNanos
-
isUTCTimestamptz
-
isoTimestampToMicros
-
isoTimestampToNanos
-
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)
-