defaultToDate

fun String.defaultToDate(format: String, locale: Locale = Locale.US): Date?

Convert a date string to a date which based on the time zone set in the System.

Return

A date if the string can be converted, or null otherwise.

Parameters

format

A date format

locale

A language locale, which the default is US.