What this animation explains
LocalDate has no time or zone. plusDays returns a new LocalDate and handles calendar boundaries.

MODULE 1 · TOPIC 9 · VISUAL PROGRAMMING LAB
Use immutable java.time objects to calculate dates, durations and zone conversions.
Browser-based simulations: change the inputs, trace the Java statements and inspect results. No arbitrary Java execution, real database, threads or file changes occur here.
Observe calendar arithmetic including leap years.
Inputs above update the example. Highlighted line indicates the current operation. Fragments marked “inside main” or requiring setup belong in the indicated Java project.
LocalDate has no time or zone. plusDays returns a new LocalDate and handles calendar boundaries.
Try February 28 in 2027 and 2028. Try February 30.
Compare elapsed minutes with calendar days.
Inputs above update the example. Highlighted line indicates the current operation. Fragments marked “inside main” or requiring setup belong in the indicated Java project.
Period is date-based. Duration is time-based; Duration.ofDays always counts 24-hour units. Zoned calendar days can differ around DST.
Set days=1 and hours=0; compare the units.
Display one instant in UTC, India or Japan.
Inputs above update the example. Highlighted line indicates the current operation. Fragments marked “inside main” or requiring setup belong in the indicated Java project.
Instant represents a point on the timeline. ZonedDateTime combines local time with zone rules. The example uses fixed date and three zones without DST on that date.
Set UTC 22:00 and choose India. Watch the date roll over.
Calculate a due date 30 days after a user-selected LocalDate; format it using DateTimeFormatter.ofPattern("dd-MM-yyyy").
Edit the scratchpad below. Copy your code into an actual Java project or IDE to compile and test it.
Use ISO-8601 parsing, DateTimeFormatter, and explicit ZoneId for predictable results. Avoid legacy mutable Date/Calendar for new code where java.time is suitable.