convertToUnixTimeStamp

fun convertToUnixTimeStamp(originDate: String, locale: Locale = Locale.getDefault(), inputPattern: String = defaultInputDatePattern, targetTimeZone: TimeZone = TimeZone.getDefault()): Long

Helper utility for converting dates in string format to unix time stamp

Return

Unix based time stamp of type Long measured in milliseconds

Parameters

originDate

input date which needs to be converted

inputPattern

pattern representing the originDate, the default is set to defaultInputDatePattern

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 convertToUnixTimeStamp(originDate: String, dateTimeFormatter: DateTimeFormatter, targetTimeZone: TimeZone = TimeZone.getDefault()): Long

Helper utility for converting dates in string format to unix time stamp

Return

Unix based time stamp of type Long measured in milliseconds

Parameters

originDate

input date which needs to be converted

dateTimeFormatter

date time format representing the originDate

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)