OffsetTime plusMinutes() method in Java with examples Last Updated : 02 Jan, 2019 Comments Improve Suggest changes Like Article Like Report The plusMinutes() method of OffsetTime class is used to add specified number of Minutes value to this OffsetTime and return the result as a OffsetTime object. This instant is immutable. The calculation wraps around midnight. Syntax: public OffsetTime plusMinutes(long MinutesToAdd) Parameters: This method accepts a single parameter MinutesToAdd which is the value of Minutes to be added, it can be a negative value. Return value: This method returns a OffsetTime based on this time with the Minutes added. Below programs illustrate the plusMinutes() method: Program 1: Java // Java program to demonstrate // OffsetTime.plusMinutes() method import java.time.*; public class GFG { public static void main(String[] args) { // create a OffsetTime object OffsetTime time = OffsetTime.parse("14:25:10+11:00"); // print OffsetTime System.out.println("OffsetTime before addition: " + time); // add 55 Minutes using plusMinutes() OffsetTime value = time.plusMinutes(55); // print result System.out.println("OffsetTime after addition: " + value); } } Output: OffsetTime before addition: 14:25:10+11:00 OffsetTime after addition: 15:20:10+11:00 Program 2: Java // Java program to demonstrate // OffsetTime.plusMinutes() method import java.time.*; public class GFG { public static void main(String[] args) { // create a OffsetTime object OffsetTime time = OffsetTime.parse("14:25:10+11:00"); // print OffsetTime System.out.println("OffsetTime before addition: " + time); // add -600 Minutes using plusMinutes() OffsetTime value = time.plusMinutes(-600); // print result System.out.println("OffsetTime after addition: " + value); } } Output: OffsetTime before addition: 14:25:10+11:00 OffsetTime after addition: 04:25:10+11:00 References: https://docs.oracle.com/javase/8/docs/api/java/time/OffsetTime.html#plusMinutes-long- Comment More infoAdvertise with us Next Article OffsetTime plusMinutes() method in Java with examples G gopaldave Follow Improve Article Tags : Java Java-Functions Java-time package Java-OffsetTime Practice Tags : Java Similar Reads OffsetDateTime plusMinutes() method in Java with examples The plusMinutes() method of OffsetDateTime class in Java returns a copy of this OffsetDateTime with the specified number of minutes added to the parsed date and time. Syntax: public OffsetDateTime plusMinutes(long minutes) Parameter: This method accepts a single parameter minutes which specifies the 2 min read OffsetTime plus() method in Java with examples In OffsetTime class, there are two types of plus() method depending upon the parameters passed to it. plus(long amountToAdd, TemporalUnit unit) plus() method of a OffsetTime class used to return a copy of this OffsetTime with the specified amount of unit added.If it is not possible to add the amount 2 min read OffsetTime plusNanos() method in Java with Examples The plusNanos() method of OffsetTime class used to add specified no of nanoseconds value to this OffsetTime and return the result as a OffsetTime object. This instant is immutable. The calculation wraps around midnight. Syntax: public OffsetTime plusNanos(long nanosecondsToAdd) Parameters: This meth 2 min read OffsetTime plusHours() method in Java with examples The plusHours() method of OffsetTime class is used to add specified no of Hours value to this OffsetTime and return the result as a OffsetTime object. This instant is immutable. The calculation wraps around midnight. Syntax: public OffsetTime plusHours(long hoursToAdd) Parameters: This method accept 2 min read OffsetDateTime plusMonths() method in Java with examples The plusMonths() method of OffsetDateTime class in Java returns a copy of this OffsetDateTime with the specified number of months added to the parsed date and time. Syntax: public OffsetDateTime plusMonths(long months) Parameter: This method accepts a single parameter months which specifies the mont 2 min read Like