Skip to content

Reference

Dates and Times

  • DateTime stores a date and time with a time-zone. It is useful if you want to perform precise date and time calculations taking into account the TimeZone, such as America/Mexico_City.

  • LocalDateTime stores a date and time without a time-zone, such as 17:30 on 3 December 2007.

  • LocalDate stores a date without a time, such as 3 December 2007. It could be used to store a birthday.

  • LocalTime stores a time without a date, such as 17:30. It could be used to store an opening or closing time.

Time Zones

  • TimeZone stores a time-zone identifier, such as America/Mexico_City. It can also store a time-zone abbreviation such as BST or a fixed offset such as -06:00.

  • Offset stores time offset from Greenwich/UTC, such as -06:00.

Durations

  • Period stores an amount of time in individual units, such as months or hours.