有人能建议一种将简单的LocalDateTime
转换为RealmInstant
的方法吗?
我已经尝试过这种方法,我的意思是这个转换后的LocalDate时间值的格式与RealmInstant的格式不同。
良好的RealmInstant值(与下面的日期/时间值不同,但格式是此处的关键):
+054848-03-16T07:54:02.000+00:00
从LocalDateTime到RealmInstant的转换错误:
2022-11-23T22:04:06.000+00:00
下面是我用来将LocalDateTime转换为RealmInstant的代码:
RealmInstant.from(
epochSeconds = LocalDateTime.of(pickedDate, pickedTime).toEpochSecond(ZoneOffset.UTC),
nanosecondAdjustment = LocalDateTime.of(pickedDate, pickedTime).nano
)
1条答案
按热度按时间nx7onnlm1#
也许解析使它的格式不同?