Я пытаюсь преобразовать время эпохи в местное время. Например
Код: Выделить всё
val epocTime = 1715244851730 // 12:24:11.730 PM GMT+03:30
Код: Выделить всё
java.text.SimpleDateFormat("HH:mm", Locale.getDefault(Locale.Category.FORMAT))
.format(Date(time)) // 13:24
Код: Выделить всё
java.time.LocalDateTime.ofInstant(
java.time.Instant.ofEpochMilli(epocTime),
java.time.ZoneId.systemDefault()
) // 13:24:11.730
Код: Выделить всё
org.threeten.bp.LocalDateTime.ofInstant(
org.threeten.bp.Instant.ofEpochMilli(epocTime),
org.threeten.bp.ZoneId.systemDefault(),
) // 12:24:11.730
Подробнее здесь: https://stackoverflow.com/questions/784 ... es-problem
Мобильная версия