java.time

ChoiceFormat

ChoiceFormat is a subclass of NumberFormat used to map numeric ranges to custom strings. It is ideal when a numeric value should be translated into a human-readable category, such as converting scores to grades, salary ranges to designations, or item quantities to messages like “few”, “many”, etc. Key Features Maps numerical ranges to specific strings. …

ChoiceFormat Read More »

ChronoZonedDateTime

ChronoZonedDateTime is useful when dealing with non-ISO calendar systems (e.g., Japanese, ThaiBuddhist, Hijrah). It holds the complete date (calendar system), time, and time-zone in a way that’s suitable for internationalization. Common Used Methods Simple Program Problem Statement: LotusJavaPrince and Mahesh are developing a historical archive management system that stores date-time information from various cultural and …

ChronoZonedDateTime Read More »

ChronoLocalDateTime

ChronoLocalDateTime<D extends ChronoLocalDate> is a generic interface in the java.time.chrono package that represents a date-time object without a time-zone, intended to support non-ISO calendar systems. It is used for handling calendar systems like Hijrah, Japanese, Minguo, and Thai Buddhist, enabling globalized applications beyond the ISO calendar. Common used Methods Simple Program Using ChronoLocalDateTime (Japanese Calendar) …

ChronoLocalDateTime Read More »

DateTimeFormatter

The DateTimeFormatter class is used to format and parse date-time objects in Java. It supports predefined standard formats, custom patterns, and locale-sensitive formatting, making it essential for applications involving date/time I/O. Commonly Used Methods Simple Program LotusJavaPrince and Mahesh are working on a global banking portal that formats user transaction timestamps according to different countries’ …

DateTimeFormatter Read More »

Clock class

The Clock class is part of the java.time package and provides an abstraction to access the current instant, date, and time using a time-zone.This abstract an class. It allows applications to: Get the current time in a consistent and testable way. Work with different time zones or offsets. Be used to inject clocks for unit …

Clock class Read More »

TemporalUnit class

The TemporalUnit interface represents a unit of time, such as days, hours, or months, and defines how these units can be added to or between temporal objects (LocalDate, LocalDateTime, etc.).It works with temporal-based classes to quantify time in a meaningful way. Common Used Methods Simple Program Problem Statement LotusJavaPrince and Mahesh are developing a training …

TemporalUnit class Read More »

TemporalAmount class

The TemporalAmount interface represents a quantity of time, such as “5 days” or “2 years and 3 months.”It defines how a time-based amount can be added to or subtracted from a temporal object such as LocalDate, LocalDateTime, etc. Common Used Methods Simple Program Problem Statement LotusJavaPrince and Mahesh are building a subscription system where: Users …

TemporalAmount class Read More »

Scroll to Top