Answers for "how to parse date to date time in kotlin"

0

string to date kotlin

val l = LocalDate.parse("14-02-2018", DateTimeFormatter.ofPattern("dd-MM-yyyy"))

val unix = l.atStartOfDay(ZoneId.systemDefault()).toInstant().epochSecond
Posted by: Guest on March-03-2021
0

get the time remaning for a date kotlin

val diff: Long = date1.getTime() - date2.getTime()
val seconds = diff / 1000
val minutes = seconds / 60
val hours = minutes / 60
val days = hours / 24
Posted by: Guest on September-26-2020

Code answers related to "how to parse date to date time in kotlin"

Browse Popular Code Answers by Language