to Date Time
Convert a string to a DateTime.
The string is assumed to be an ISO-8601 date-time representation in extended format. For example, 2019-08-22T18:00 or 2019-08-22 18:00:30.123456789. The output of DateTime.toString can be safely parsed using this method.
Throws
if parsing fails
if the parsed date-time is invalid
fun String.toDateTime(parser: DateTimeParser, settings: DateTimeParserSettings = DateTimeParserSettings.DEFAULT): DateTime
Content copied to clipboard
Converts a string to a DateTime using a specific parser.
A set of predefined parsers can be found in DateTimeParsers.
Any custom parser must be capable of supplying the fields necessary to resolve both a Date and Time.
Throws
if parsing fails
if the parsed date-time is invalid