Author name: javaplanet.io

TemporalAdjusters class

The TemporalAdjusters class, part of java.time.temporal, provides common date adjustment operations as static methods that return TemporalAdjuster instances. These are used with date-time objects to manipulate or align them to significant calendar dates—like the first day of the month, next Monday, etc. Commonly Used Methods Simple Program Problem Statement LotusJavaPrince and Mahesh are building a […]

TemporalAdjusters class Read More »

ZoneRules class

The ZoneRules class in the java.time.zone package defines the rules for converting between an Instant and a local date-time, for a particular ZoneId. It encapsulates standard offsets, daylight saving time (DST) transitions, and other complex time zone behaviors. Commonly Used Methods Simple Program Problem Statement LotusJavaPrince and Mahesh are building a flight booking system that

ZoneRules class Read More »

ZoneOffset class

ZoneOffset represents a fixed offset from the UTC/Greenwich time (e.g., +05:30, -08:00). Unlike ZoneId, which includes daylight saving rules, ZoneOffset is a constant offset used by classes like OffsetDateTime and ZonedDateTime. Commonly Used Methods Simple Program Problem Statement LotusJavaPrince and Mahesh are creating a world clock dashboard. Each time zone is stored as a ZoneOffset

ZoneOffset class Read More »

OffsetDateTime class

The OffsetDateTime class represents a date-time with an offset from UTC/Greenwich in the ISO-8601 calendar system (e.g., 2024-06-01T10:15:30+05:30) Commonly Used Methods Simple Program Problem Statement LotusJavaPrince and LotusPythonPrince are building a secure messaging platform where all timestamps must be recorded in UTC but displayed in the sender’s local offset. They need to: Capture message send

OffsetDateTime class Read More »

ZoneId class

The ZoneId class represents a time zone identifier, used to manage and apply time zone rules. It provides access to the rules and names of various time zones (like Asia/Kolkata, America/New_York, etc.). It is often used with ZonedDateTime to attach a time zone to a date-time. Commonly Used Methods Simple Program Problem Statement LotusJavaPrince and

ZoneId class Read More »

ZonedDateTime class

ZonedDateTime represents a date and time with a time-zone in the ISO-8601 calendar system. It is ideal for global applications where you must consider time zones and daylight saving time. Commonly Used Methods Simple Program LotusJavaPrince and Mahesh are working on a global conference scheduler. Users from different countries submit their local meeting times, and

ZonedDateTime class Read More »

LocalDateTime

java.time.LocalDateTime represents a date and time without a time zone. It is a combination of LocalDate and LocalTime. Commonly Used Methods Simple Program Problem Statement LotusJavaPrince and Mahesh are building a meeting reminder system for employees. Each reminder must be scheduled precisely with date and time. The system should: Take input for meeting date and

LocalDateTime Read More »

LocalTime class

The java.time.LocalTime class represents a time without a date and without time zone information, using hour, minute, second, and nanosecond. Commonly Used Methods Simple Program Problem Statement LotusJavaPrince and LotusPythonPrince are creating a conference room scheduler for the TechMind Event Center. Each room has defined opening and closing times. They need to: Accept user input

LocalTime class Read More »

LocalDate

The java.time.LocalDate class represents a date without time (year, month, day) in the ISO-8601 calendar system. It does not include time or timezone information. Commonly Used Methods Simple Program Problem Statement Paani and Mahesh are building a customer onboarding system for LoanTrust Bank. The system needs to: Capture the customer’s date of birth. Calculate the

LocalDate Read More »

Scroll to Top