Java Data Type How to - Add hour and minute to instant


We would like to know how to add hour and minute to instant.


import java.time.Instant;
import java.time.temporal.ChronoUnit;
//from   ww w .  java2 s. com
public class Main {

  public static void main(String[] args) {
    Instant t1 =;
    long hours = 2;
    long minutes = 30;
    Instant t2 =, ChronoUnit.HOURS).plus(minutes,

    System.out.println(String.format("now %s and later %s", t1, t2));

The code above generates the following result.