Consider code:
public static void main(String[] args) {
System.out.println(LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd-HH")));
}
The output is 2022-05-04-17
while UTC time is 2022-05-04-10
. The documentation says that LocalDateTime
is without zone offset - so why there is 7 hour shift? (My local time zone is +7UTC
)
LocalDateTime
.