为什么用下面的代码生成的日期将给定时间偏移到 11:00:00.00?
test("shouldReturnGivenMockedDateTime") {
val mockedDateTime = "2020-01-01T10:00:00.00Z"
val clock: Clock = Clock.fixed(Instant.parse(mockedDateTime), TimeZone.getDefault.toZoneId);
val result = LocalDateTime.ofInstant(clock.instant, TimeZone.getDefault.toZoneId)
assert(result.toString == "2020-01-01T10:00") // FALSE!!!
assert(result.toString == "2020-01-01T11:00") // TRUE
}
Run Code Online (Sandbox Code Playgroud)