LocalTime plus(TemporalAmount amountToAdd) example
Description
LocalTime plus(TemporalAmount amountToAdd)
returns a
copy of this time with the specified amount added.
Syntax
plus
has the following syntax.
public LocalTime plus(TemporalAmount amountToAdd)
Example
The following example shows how to use plus
.
import java.time.Duration;
import java.time.LocalTime;
/*from w w w . j a va2s . c o m*/
public class Main {
public static void main(String[] args) {
LocalTime l = LocalTime.now();
LocalTime s = l.plus(Duration.ofHours(1));
System.out.println(s);
}
}
The code above generates the following result.