java.time

Peroid class

The java.time.Period class represents a date-based amount of time in terms of years, months, and days. It is used to model calendar-based differences, like “2 years and 3 months” or “10 days”. Commonly Used Methods Simple Program Problem Statement LotusJavaPrince and Mahesh are building a loan management system for Sunrise Microfinance. The requirement is: When …

Peroid class Read More »

Duration class

The java.time.Duration class models a time-based amount of time measured in seconds and nanoseconds. It is ideal for measuring time between two Instant values or defining fixed time periods (e.g., wait 5 seconds, time out after 2 minutes). Commonly Used Methods  Simple Program Problem Statement LotusJavaPrince and LotusPythonPrince are working on a performance monitoring system …

Duration class Read More »

Instant class

The java.time.Instant class represents a specific moment on the time-line in UTC (Coordinated Universal Time). It is a machine-readable timestamp and is commonly used for recording timestamps in logs, measuring time intervals, or working with system clocks. It is immutable and thread-safe. The epoch reference point is 1970-01-01T00:00:00Z (UTC). Commonly Used Methods of Instant Simple …

Instant class Read More »

Scroll to Top