convertToTimeStamp

fun convertToTimeStamp(originDate: String, locale: Locale = Locale.getDefault(), inputPattern: String = defaultInputDatePattern, outputDatePattern: String = defaultOutputDatePattern, targetTimeZone: TimeZone = TimeZone.getDefault()): String

Helper utility for converting dates in string format from one date type to the other

Return

date string following the output pattern of outputDatePattern

Parameters

originDate

input date which needs to be converted

inputPattern

pattern representing the originDate, the default is set to defaultInputDatePattern

outputDatePattern

pattern that will be used create the output, by default this is set to defaultOutputDatePattern

targetTimeZone

time zone that the output will be converted to, by default the timezone is set to whatever the current device is set to

See also

DateTimeFormatter

(https://developer.android.com/reference/java/time/format/DateTimeFormatter)


fun convertToTimeStamp(originDate: String, locale: Locale = Locale.getDefault(), dateTimeFormatter: DateTimeFormatter, outputDatePattern: String = defaultOutputDatePattern, targetTimeZone: TimeZone = TimeZone.getDefault()): String

Helper utility for converting dates in string format from one date type to the other

Return

date string following the output pattern of outputDatePattern

Parameters

originDate

input date which needs to be converted

dateTimeFormatter

time format representing the originDate

outputDatePattern

pattern that will be used create the output, by default this is set to defaultOutputDatePattern

targetTimeZone

time zone that the output will be converted to, by default the timezone is set to whatever the current device is set to

See also

DateTimeFormatter

(https://developer.android.com/reference/java/time/format/DateTimeFormatter)