kurt_steiner
12/16/2023, 2:04 PMval CURRENT_TIME_ZONE = TimeZone.of("Asia/Shanghai")
fun shanghaiNow() = Clock.System.now().toLocalDateTime(CURRENT_TIME_ZONE).toInstant(UtcOffset(hours = 8))
but I found that, when creating it many times, the length of them are not the same,
do you know how to fix it ?andylamax
12/17/2023, 2:11 AMkurt_steiner
12/17/2023, 9:14 AMandylamax
12/17/2023, 10:08 AMkurt_steiner
12/17/2023, 10:09 AMandylamax
12/17/2023, 1:40 PM2023-12-16 21:51:29.544
is the same as 2023-12-16 21:51:29.544000
kurt_steiner
12/17/2023, 1:41 PMval date = ZonedDateTime.parse(isostring).toInstant()
val result = formatDateFormat.format(date.atZone(ZoneOffset.UTC))