Skip to content
Advertisement

Tag: truncate

Java LocalDateTime remove the milliseconds from UTC timezone

I am trying to truncate milliseconds from a UTC time zone. I have the code below where I am able to remove milliseconds but I still get the Z at the end. This outputs the following: ====Event date Time before truncate=== 2021-03-09T20:46:24.081Z ====Event date Time after truncate=== 2021-03-09T20:46:24Z Answer The Z is the timezone information. You can convert the OffsetDateTime

Advertisement