I am trying to ensure that calling toString()
on my ZonedDateTime
Object will comply with ISO-8601 format.
The documentation for the toString()
method states:
...The output is compatible with ISO-8601 if the offset and ID are the same
Does this mean that there exists a situation where calling
zdt.getOffset()
will return something different than
zdt.getZone().getRules().getOffset(zdt.toInstant())
?
This doesn't seem to make sense.
Can someone provide an example in which the offset and ID are not the same (ie: where toString()
does not comply with ISO-8601) so that I can better understand the description in the documentation.