My input is unix seconds from epoch, which represents the date, that I need to work with, I need to convert the date to start time of a day and end time of a day of the same date, what are possible options to do so in Kotlin?
You could use LocalDate
to easily achieve this behaviour using epoch
val localDate = Instant.ofEpochMilli(timeInEpoch).atZone(ZoneId.systemDefault()).toLocalDate()
val startDate = localDate.atStartOfDay() // (or) localDate.atTime(LocalTime.MIN)
val endDate = localDate.atTime(LocalTime.MAX)