Java Date Time - OffsetTime minusMinutes(long minutes) example








OffsetTime minusMinutes(long minutes) returns a copy of this OffsetTime with the specified period in minutes subtracted.

Syntax

minusMinutes has the following syntax.

public OffsetTime minusMinutes(long minutes)

Example

The following example shows how to use minusMinutes.

import java.time.OffsetTime;
/*from w  ww  .ja va2s .c  o  m*/
public class Main {
  public static void main(String[] args) {
    OffsetTime m = OffsetTime.now();
    OffsetTime n = m.minusMinutes(14);
    System.out.println(n);

  }
}

The code above generates the following result.