How to add hours and minutes to Java Instant

To add hours or minutes to the Java Instant Class object we can make use of the plus methods from the Instant class.

import java.time.Instant;
import java.time.temporal.ChronoUnit;

public class JavaInstantClassExample {

    public static void main(String[] args) {

        int hoursToAdd = 4;
        int minutesToAdd = 30;
        Instant currentTimeStampInUTC =;
        System.out.println("Current Time: "+currentTimeStampInUTC);

        System.out.println("Adding 4 hours and 30 minutes to current time");
        Instant laterTime =,ChronoUnit.HOURS)
        System.out.println("Later Time: "+laterTime);
Current Time: 2022-05-13T18:37:55.991272Z
Adding 4 hours and 30 minutes to current time
Later Time: 2022-05-13T23:07:55.991272Z
Java Instant class add hours and minutes
Try Out Code2care Dev Tools:


Code2care is an initiative to publish and share varied knowledge in programming and technical areas gathered during day-to-day learnings and development activities.

Students and software developers can leverage this portal to find solutions to their various queries without re-inventing the wheel by referring to our easy to understand posts. Technical posts might include learnings, tutorials, trouble-shooting steps, video tutorials, code snippets, how-to, blogs, articles, etc.

🎉 We are celebrating the 10th years of Code2care! Thank you for all your support!

We strongly support Gender Equality & Diversity.