Closed niclash closed 7 years ago
This is a misunderstanding. As per the docs, EPOCH_DAY is a local value, where no time-zone is involved. As such, conversion from a local epoch day to a LocalDate
requires no time-zone (they are using the same local time-line). UTC is not relevant to the conversion, thus not mentioned.
Ok, I acknowledge that ofEpochDay() does what it is supposed to do. BUT for future reference this is "poor name choice", since it varies in definition from ofEpochMillis(). Intuitively, most of us would assume that there is >0 epochMillis/epochSeconds in an epochDay. so to speak, but the former are defined differently than the latter. I also realize that it is too late to change now. Thanks for the quick RTFM response, Stephen. I should have assumed that you were right all along.
IIUIC, the LocalDate.ofEpochDay() uses UTC time zone for computing the localdate and not the system default timezone, nor does it allow a time zone to be provided.
This is probably an oversight either in the thinking (no days are not time zone dependent - wrong) or oversight in documenting what is exactly happening.
I am simply suggesting that the Javadoc is updated to state that UTC is used, which could go into a patch release.