Edit below with summary of answer:
I'm trying to understand a bit more about java.time.Instant and leap seconds. If I run this:
System.out.println(Instant.ofEpochSecond(60*60*24*365*50));
I expected to create a time/date that's near the start of 2020-being 50 lots of 365 days after Jan 1, 1970, so allowing for a bunch of leap years, a few days short. I do indeed get such a date. So far so good.
The date/time I get shows as 2019-12-20T00:00:00Z
. What I'm surprised by is that I thought the result would also be a few seconds shy of midnight, due to leap seconds. But it's exactly midnight UTC.
Am I misunderstanding leap seconds, or java.time.Instant (or perhaps something else entirely!)?
EDIT: as commenters have pointed out, Java time isn't required to do anything about leap seconds, probably because Unix time ignores them, and the reason for that is called out in a Wikipedia article and indirectly through another question. The crux seems to be that future leap seconds aren't predictable, but get added when astronomers agree the Earth has slowed enough to warrant it. And it seems that that slowing is not predictable.
Note, I didn't delete my question since the association between Unix time and java time is not mentioned in the question that others referred to, so I believe this adds something of some small merit.
Thanks for the input!