Java Date Time - LocalDateTime plusMinutes(long minutes) example








LocalDateTime plusMinutes(long minutes) returns a copy of this LocalDateTime with the specified period in minutes added.

Syntax

plusMinutes has the following syntax.

public LocalDateTime plusMinutes(long minutes)

Example

The following example shows how to use plusMinutes.

import java.time.LocalDateTime;
/*w  w  w . ja  v a2s .c om*/
public class Main {
  public static void main(String[] args) {
    LocalDateTime a = LocalDateTime.of(2014, 6, 30, 12, 00);
    
    LocalDateTime t = a.plusMinutes(100);
    
    System.out.println(t);
  }
}

The code above generates the following result.