Convert LocalDateTime UTC To System Local Timezone

May 17, 2018
And Local Timezone to UTC

Convert UTC to System/Local Timezone

val localDateTime = uctLocalDateTime.atZone(ZoneOffset.UTC).withZoneSameInstant(ZoneId.systemDefault()).toLocalDateTime()

Convert System/Local Timezone to UTC

val utcDateTime = localDateTime.atZone(ZoneId.systemDefault()).withZoneSameInstant(ZoneOffset.UTC).toLocalDateTime()
This work is licensed under a
Creative Commons Attribution-NonCommercial 4.0 International License.