Period normalized() example

Description

Period normalized() returns a copy of this period with the years and months normalized.

Syntax

normalized has the following syntax.


public Period normalized()

Example

The following example shows how to use normalized.


import java.time.Period;
//w  w  w.j av a 2 s . co  m
public class Main {
  public static void main(String[] args) {
    Period p = Period.ofMonths(123);
    
    Period l = p.normalized();
    System.out.println(l);

  }
}

The code above generates the following result.





















Home »
  Java Date Time »
    java.time Reference »




Clock
DayOfWeek
Duration
Instant
LocalDate
LocalDateTime
LocalTime
Month
MonthDay
OffsetDateTime
OffsetTime
Period
Year
YearMonth
ZonedDateTime
ZoneId
ZoneOffset