Date and Time

LocalDate

Examples:

The date to day is 13 May 2018

NOTE the return values is just the toString() representation of LocalDate.

  • Getting current date, in format YYYY-MM-DD

Can do some maths with the date

  • There are lots of methods to use

Can do some comparisions

Formatting the date

Parsing string date

Creating Date

Get parts of the date

Alter parts of the date

LocalTime

Very similar methods to those in LocalDate

LocalDateTime

Very similar methods to those in LocalDate

ZoneDateTime

Duration

Time measurement

A great way of measuring how long a method call takes.

Last updated

Was this helpful?