public class DateTimeUtils extends Object
NOTE: Copied from Flink.
Modifier and Type | Field and Description |
---|---|
static int |
EPOCH_JULIAN
The julian date of the epoch, 1970-01-01.
|
static TimeZone |
LOCAL_TZ
The local time zone.
|
static long |
MILLIS_PER_DAY
The number of milliseconds in a day.
|
Constructor and Description |
---|
DateTimeUtils() |
Modifier and Type | Method and Description |
---|---|
static Integer |
parseDate(String s) |
static Integer |
parseTime(String v) |
static org.apache.flink.table.data.TimestampData |
parseTimestampData(String dateStr,
int precision) |
static int |
toInternal(Date date)
Converts the Java type used for UDF parameters of SQL DATE type (
Date ) to
internal representation (int). |
static int |
toInternal(java.time.LocalDate date) |
static Date |
toSQLDate(int v)
Converts the internal representation of a SQL DATE (int) to the Java type used for UDF
parameters (
Date ). |
public static final int EPOCH_JULIAN
public static final long MILLIS_PER_DAY
This is the modulo 'mask' used when converting TIMESTAMP values to DATE and TIME values.
public static final TimeZone LOCAL_TZ
public static Date toSQLDate(int v)
Date
).public static int toInternal(Date date)
Date
) to
internal representation (int).public static int toInternal(java.time.LocalDate date)
public static org.apache.flink.table.data.TimestampData parseTimestampData(String dateStr, int precision) throws java.time.DateTimeException
java.time.DateTimeException
Copyright © 2019–2023 The Apache Software Foundation. All rights reserved.