Package org.apache.drill.exec.udfs
Class DateUtilFunctions
java.lang.Object
org.apache.drill.exec.udfs.DateUtilFunctions
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic LocalDate
getDateFromString
(String inputString) Parses common date strings and returns aLocalDate
of that string.static LocalDate
getDateFromString
(String inputString, boolean leadingDay) Parses common date strings and returns aLocalDate
of that string.static LocalDateTime
getTimestampFromString
(String inputString)
-
Constructor Details
-
DateUtilFunctions
public DateUtilFunctions()
-
-
Method Details
-
getDateFromString
Parses common date strings and returns aLocalDate
of that string. If the method is unable to parse the string, an error will be logged. Supports the following formats:- yyyy-MM-dd
- MM/dd/yyyy
- M/d/yyyy
- yyyy/MM/dd
- Parameters:
inputString
- An input string containing a date.- Returns:
- A
LocalDate
of the input string.
-
getDateFromString
Parses common date strings and returns aLocalDate
of that string. If the method is unable to parse the string, an error will be logged. Supports the following formats:- yyyy-MM-dd
- MM/dd/yyyy
- dd/MM/yyyy
- M/d/yyyy
- yyyy/MM/dd
- Parameters:
inputString
- An input string containing a date.leadingDay
- True if the format has the day first.- Returns:
- A
LocalDate
of the input string.
-
getTimestampFromString
-