Given the following code:
What is the result?
minusDays(-1) advances the date by one day, and the conditional expression evaluates to false, leaving the date-time at 2021-01-02T11:11. DateTimeFormatter pattern letter H denotes hour-of-day, while uppercase M denotes month-of-year; therefore HHMM formats this value as 1101.
minusDays(-1)
DateTimeFormatter
H
M
HHMM
1101
Community Discussion