- Class LocalDate --> date
- Class LocalTime --> time
- Class LocalDateTime --> timestamp
The new date and time classes are thread safe (they are not mutable and can be used in multithread). This is an advantage respect from the previous API (Date and Calendar classes).
Examples with dates (LocalDate class)
- get current date
- set date methods of/with
- dayOfWeek, yearMonth, year
- parsing dates
- calculations (plus/minus)
- comparing dates
- Period class
Examples with time (LocalTime class)
- LocalTime current time, constants
- Duration : calculation with times
- LocalDateTime : obtain timestamp
No comments:
Post a Comment