library / org.akop.kotx.types / kotlin.String

Extensions for kotlin.String

toDateFormat

fun String.toDateFormat(timeZoneId: String? = null, locale: Locale? = Locale.getDefault()): DateFormat

Converts receiver to a DateFormat object, with optional timeZoneId and locale.

toDateTime

fun String.toDateTime(format: DateFormat): DateTime

Calls DateTime.parse to parse a string in specified format.