toDate

fun String.toDate(fromFormat: String, locale: Locale = Locale.getDefault()): Date

Extension function of String to parse String as a Date

Return

parsed Date from the given String

Receiver

String

Parameters

fromFormat

pattern of the String to parse

locale

type to locale to parse the String


fun Long.toDate(toFormat: String, locale: Locale = Locale.getDefault()): String

Extension function of Long to parse unix timestamp as String in the form of Date

Return

parsed String from the given Date

Receiver

Long

Parameters

toFormat

pattern of the String to format

locale

type of locale to format the Date