Class DateTimeParser
java.lang.Object
io.nosqlbench.virtdata.library.basics.shared.from_string.to_epoch.DateTimeParser
This function will parse a String containing a formatted
date time, yielding a DateTime object.
If no arguments are provided, then the format is set to
"yyyy-MM-dd HH:mm:ss.SSSZ".
For details on formatting options, see @see DateTimeFormat
-
Constructor Summary
ConstructorsConstructorDescriptionInitialize the parser with the default pattern ofDateTimeParser(String dateTimePattern) Initialize the parser with the given pattern.DateTimeParser(String dateTimePattern, String defaultTime) Initialize the parser with the given pattern and default value. -
Method Summary
-
Constructor Details
-
DateTimeParser
public DateTimeParser()Initialize the parser with the default pattern ofyyyy-MM-dd HH:mm:ss.SSSZ
. -
DateTimeParser
Initialize the parser with the given pattern. With this form, if any input fails to parse, or is null or empty, then an exception is thrown.- Parameters:
dateTimePattern- The pattern which represents the incoming format.
-
DateTimeParser
Initialize the parser with the given pattern and default value. In this form, if any input fails to parse, then exceptions are suppressed and the default is provided instead. At initialization, the default is parsed as a sanity check.- Parameters:
dateTimePattern- The pattern which represents the incoming format.defaultTime- An example of a formatted datetime string which is used as a default.
-
-
Method Details
-
apply
-