Review midnight based methods #106

Closed
RogerRiggs opened this Issue Oct 1, 2012 · 2 comments

Comments

Projects
None yet
2 participants
Contributor

RogerRiggs commented Oct 1, 2012

There are a number of method that have limited usefulness, ambiguous semantics and should be removed. The atMidnight and ofMidnight methods can be confusing because they indicate a time of 00:00 but at least in the US, midnight is at the end of the day. 24:00.
Developers are unlike to expect or go look for those methods and more naturally look to replace the time with 0,0. The LocalTime.MIDNIGHT constant is similarly ambiguous.
The startOfDayInZone method is also unnecessary since all the days start at 00:00.
There are plenty of methods that take hh, mm arguments that developers would be expected to find and use before these specialized methods.

(Edited title for clarity)

Owner

jodastephen commented Oct 1, 2012

The methods are clearly defined, and LocalTime.MIDNIGHT is an obvious constant that should not be removed.

startOfDayInZone has very useful semantics, as some time-zones skip 00:00 to 01:00 in a DST change, so setting to 00:00 will be an error.

Owner

jodastephen commented Oct 5, 2012

Agreed ZDT.of(...) should accept date-times in middle of DST gap and adjust to avoid unecessary exceptions.

Agreed to remove all other midnight methods due to potential midnight end of day confusion. LocalTime constant to be retained.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment