Java.Time Namespace
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Provides the main API for dates, times, instants, and durations.
Classes
| Name | Description |
|---|---|
| Clock |
A clock providing access to the current instant, date and time using a time-zone. |
| DateTimeException |
Exception used to indicate a problem while calculating a date-time. |
| DayOfWeek |
A day-of-week, such as 'Tuesday'. |
| Duration |
A time-based amount of time, such as '34. |
| Instant |
An instantaneous point on the time-line. |
| LocalDate |
A date without a time-zone in the ISO-8601 calendar system,
such as |
| LocalDateTime |
A date-time without a time-zone in the ISO-8601 calendar system,
such as |
| LocalTime |
A time without a time-zone in the ISO-8601 calendar system,
such as |
| Month |
A month-of-year, such as 'July'. |
| MonthDay |
A month-day in the ISO-8601 calendar system, such as |
| OffsetDateTime |
A date-time with an offset from UTC/Greenwich in the ISO-8601 calendar system,
such as |
| OffsetTime |
A time with an offset from UTC/Greenwich in the ISO-8601 calendar system,
such as |
| Period |
A date-based amount of time in the ISO-8601 calendar system, such as '2 years, 3 months and 4 days'. |
| Year |
A year in the ISO-8601 calendar system, such as |
| YearMonth |
A year-month in the ISO-8601 calendar system, such as |
| ZonedDateTime |
A date-time with a time-zone in the ISO-8601 calendar system,
such as |
| ZoneId |
A time-zone ID, such as |
| ZoneOffset |
A time-zone offset from Greenwich/UTC, such as |
Interfaces
| Name | Description |
|---|---|
| IInstantSource |
Provides access to the current instant. |
Remarks
The types in this namespace represent instants, durations, dates, times, time zones, and periods based on the ISO calendar system.
All classes are immutable and thread-safe. For low-level field access, use Java.Time.Temporal; for customized printing and parsing, use Java.Time.Format.
Java.Time.Chrono provides calendar-neutral APIs for applications that use localized calendars. Applications should use the ISO date-time types in this namespace across system boundaries.