CLOVIS
12/17/2024, 2:33 PMInstant
. For a given TimeZone
(thus I can get a LocalDateTime
), I want to know the very first existing hour of the next day in that timezone.
For example, if I have 23h47 december 17th in France, I want 00h00 december 18th. If 00h00 december 18th doesn't exist for whatever reason, I want the very next time that happens in that timezone, however later it happens to be.
How can I represent this?CLOVIS
12/17/2024, 2:36 PMDmitry Khalanskiy [JB]
12/17/2024, 2:37 PMlocal.date.plus(1, DateTimeUnit.DAY).atStartOfDayIn(timeZone).toLocalDateTime(timeZone)
?CLOVIS
12/17/2024, 3:03 PMDaniel Pitts
12/17/2024, 3:41 PMStylianos Gakis
12/17/2024, 3:46 PMDaniel Pitts
12/17/2024, 4:02 PM1.days
can not be added to LocalDate or LocaleDateTime. The .plus
method most people would expect to be able to use an operator, so I was trying local + 1.days
and other variations. local + (autocomplete)
doesn't provide any hints.CLOVIS
12/17/2024, 4:03 PMlocal.<tab>
gives nothing useful, I didn't think of decomposing it into a date and doing math on that
It makes complete sense that it would be done this way, but I didn't think of itCLOVIS
12/17/2024, 4:05 PMLocalDateTime
makes no senseDaniel Pitts
12/17/2024, 5:35 PMDaniel Pitts
12/17/2024, 5:36 PMCLOVIS
12/17/2024, 8:25 PMDaniel Pitts
12/17/2024, 8:29 PM