In C#, DateTime.AddDays moves a date forward by a number of days. Use a negative number to go back. The number is a double, so 1.5 means one and a half days.
The method follows the real calendar: it rolls over month ends and understands leap years. The time of day stays the same unless you add a fraction.
This is an instance member of System.DateTime. You call it on a DateTime value, such as dt.AddDays(...). DateTime is a struct, so every value is copied and never changed in place.
Syntax
Call AddDays on a DateTime and pass the number of days.
C#
DateTime dt = new DateTime(2026, 11, 18, 14, 30, 45);
DateTime a = dt.AddDays(10); // 2026-11-28
DateTime b = dt.AddDays(-18); // 2026-10-31
DateTime c = dt.AddDays(1.5); // adds 36 hours
Call
What it does
dt.AddDays(10)
Ten days later, same time of day.
dt.AddDays(-18)
Eighteen days earlier.
dt.AddDays(1.5)
One day and twelve hours later.
Fractions are allowed. AddDays(0.25) adds six hours. For whole calendar months or years use AddMonths or AddYears instead.
Library declarations
C#
public DateTime AddDays(double value);
Parameters
Parameter
Description
value
Required. Number of days to add. Negative values go backward; fractions are allowed.
Return Value
Return Value
Description
DateTime
A new DateTime that is value days away. The Kind is kept.
C# Examples
Example 1 — Add and Subtract Days
Show a forward move, a backward move, and the unchanged original.
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.AddDays(10)));
Console.WriteLine(Show(dt.AddDays(-18)));
Console.WriteLine(Show(dt));
}
}