toDate

fun String.toDate(): Date

Converts a string to a Date.

The string is assumed to be an ISO-8601 calendar date in extended format. For example, 2010-10-05. The output of Date.toString can be safely parsed using this method.

Throws

fun String.toDate(parser: DateTimeParser, settings: DateTimeParserSettings = DateTimeParserSettings.DEFAULT): Date

Converts a string to a Date using a specific parser.

A set of predefined parsers can be found in DateTimeParsers.

Any custom parser must be capable of supplying one of the following field combinations:

Throws