OffsetTime plus(TemporalAmount amountToAdd) example

Description

OffsetTime plus(TemporalAmount amountToAdd) returns a copy of this time with the specified amount added.

Syntax

plus has the following syntax.


public OffsetTime plus(TemporalAmount amountToAdd)

Example

The following example shows how to use plus.


import java.time.OffsetTime;
import java.time.Period;
//from   w w w . j a va 2  s . com
public class Main {
  public static void main(String[] args) {
    OffsetTime m = OffsetTime.now();
    OffsetTime n = m.plus(Period.ofDays(12));
    System.out.println(n);

  }
}




















Home »
  Java Date Time »
    java.time Reference »




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