Package org.apache.drill.exec.udfs
Class DateUtilFunctions
java.lang.Object
org.apache.drill.exec.udfs.DateUtilFunctions
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic LocalDategetDateFromString(String inputString) Parses common date strings and returns aLocalDateof that string.static LocalDategetDateFromString(String inputString, boolean leadingDay) Parses common date strings and returns aLocalDateof that string.static LocalDateTimegetTimestampFromString(String inputString)
-
Constructor Details
-
DateUtilFunctions
public DateUtilFunctions()
-
-
Method Details
-
getDateFromString
Parses common date strings and returns aLocalDateof 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
LocalDateof the input string.
-
getDateFromString
Parses common date strings and returns aLocalDateof 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
LocalDateof the input string.
-
getTimestampFromString
-