C# DateTime AddMinutes() Method

Beginner
5 min read
Updated: Nov 2026
3 examples
DateTime

Definition

In C#, DateTime.AddMinutes moves a date and time forward or back by minutes. The argument is a double, so 0.5 means thirty seconds.

It is perfect for meeting slots, reminders, and short timers. If the minutes pass midnight, the date part changes automatically.

This is an instance member of System.DateTime. You call it on a DateTime value, such as dt.AddMinutes(...). DateTime is a struct, so every value is copied and never changed in place.

Syntax

Pass the number of minutes to AddMinutes.

C#
DateTime dt = new DateTime(2026, 11, 18, 14, 30, 45);
DateTime a = dt.AddMinutes(45);    // 15:15:45
DateTime b = dt.AddMinutes(-31);   // 13:59:45
DateTime c = dt.AddMinutes(0.5);   // 14:31:15
CallWhat it does
dt.AddMinutes(45)Forty-five minutes later.
dt.AddMinutes(-31)Thirty-one minutes earlier, which crosses an hour mark.
dt.AddMinutes(0.5)Thirty seconds later.

Use AddMinutes inside a loop to build time slots. Keep the start value separate so each slot is computed from the same base.

Library declarations
C#
public DateTime AddMinutes(double value);

Parameters

ParameterDescription
valueRequired. Number of minutes to add. Negative values go backward; fractions are allowed.

Return Value

Return ValueDescription
DateTimeA new DateTime shifted by value minutes, with the same Kind.

C# Examples

Example 1 — Shift by Minutes

Add 45 minutes and subtract 31 minutes from a fixed time.

C#
using System;
using System.Globalization;

class Program {
    static string Show(DateTime d) => d.ToString("yyyy-MM-dd HH:mm:ss", CultureInfo.InvariantCulture);

    static void Main() {
        DateTime dt = new DateTime(2026, 11, 18, 14, 30, 45);
        Console.WriteLine(Show(dt.AddMinutes(45)));
        Console.WriteLine(Show(dt.AddMinutes(-31)));
    }
}

How It Works

  1. Plus 45. 14:30 plus 45 minutes is 15:15; seconds stay 45.
  2. Minus 31. 14:30 minus 31 minutes goes under the hour, to 13:59.
  3. Hour carries. The hour value changes by itself when minutes overflow or underflow.
  4. Seconds untouched. Whole minutes never alter the 45 seconds.

Example 2 — Cross to the Next Day

Add 90 minutes late in the evening.

C#
using System;
using System.Globalization;

class Program {
    static string Show(DateTime d) => d.ToString("yyyy-MM-dd HH:mm:ss", CultureInfo.InvariantCulture);

    static void Main() {
        DateTime late = new DateTime(2026, 11, 18, 23, 0, 0);
        DateTime next = late.AddMinutes(90);
        Console.WriteLine(Show(next));
        Console.WriteLine(next.Day);
    }
}

How It Works

  1. Late start. The time is 23:00 on November 18.
  2. 90 minutes. One hour reaches midnight and 30 more minutes follow.
  3. New day. The result belongs to November 19 at 00:30.
  4. Day property. next.Day prints 19, proving the date part moved forward.

Example 3 — Build Appointment Slots

Create four 20-minute slots starting at 09:00.

C#
using System;
using System.Globalization;

class Program {
    static void Main() {
        DateTime start = new DateTime(2026, 11, 18, 9, 0, 0);
        for (int i = 0; i < 4; i++) {
            DateTime slot = start.AddMinutes(i * 20);
            Console.WriteLine(slot.ToString("HH:mm", CultureInfo.InvariantCulture));
        }
    }
}

How It Works

  1. One base value. start stays at 09:00 for the whole loop.
  2. Multiply the step. i * 20 gives 0, 20, 40, and 60 minutes.
  3. No drift. Each slot is computed from the base, so rounding errors cannot pile up.
  4. HH:mm output. The 24-hour pattern shows the slots as simple clock times.

Frequently Asked Questions

Yes. AddMinutes(0.5) adds thirty seconds.
Yes. When minutes overflow past 59 or go below 0, the hour (and the date) update automatically.
Keep one start value and call start.AddMinutes(i * step) inside a loop.
Yes. Both return the same value.
No. DateTime is immutable, so use the returned value.

Next: AddMonths()

Add or subtract whole months; the day is clamped when the target month is shorter with System.DateTime.

AddMonths() tutorial →

About the author

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.

11 people found this page helpful