Colton Idle
12/01/2021, 6:06 AMknthmn
12/01/2021, 6:27 AMSergio C.
12/01/2021, 9:56 AMSergio C.
12/01/2021, 9:58 AMColton Idle
12/01/2021, 1:46 PMCasey Brooks
12/01/2021, 3:46 PMjava.time
APIs are the way to go. There's lots of date/time-related classes there which all work very nicely for whatever the scenario you need (LocalDate, LocalDateTime, YearMonth, Month enums, etc.)Colton Idle
12/01/2021, 6:05 PMCasey Brooks
12/01/2021, 9:09 PMCalendar
and Date
Java stdlib classes are always an option too, but they both have significant drawbacks, including a pretty horrendous API. You absolutely can compute relative dates/times with them, but it is painful. Definitely prefer the java.time APIs if you can, for your own sanity's sake