ZonedDateTime.toString()

ZonedDateTime.toString() occasionally does not have millisec as follows:

gist.github.com

ZonedDateTime.toString() uses LocalTime.toString().

And LocalTime.toString() omits trailing zeros.

The output will be one of the following ISO-8601 formats:

HH:mm

HH:mm:ss

HH:mm:ss.SSS

HH:mm:ss.SSSSSS

HH:mm:ss.SSSSSSSSS

The format used will be the shortest that outputs the full value of the time where the omitted parts are implied to be zero.

LocalTime (Java Platform SE 8 )

LocalTime.toString() implementation is as follows:

gist.github.com