In C#, a tick is 100 nanoseconds, the smallest unit a DateTime stores. DateTime.AddTicks moves a value by a long number of ticks.
Most programs use AddSeconds or AddDays. Reach for AddTicks when you need the finest step or when you already work with raw tick counts.
This is an instance member of System.DateTime. You call it on a DateTime value, such as dt.AddTicks(...). DateTime is a struct, so every value is copied and never changed in place.
Syntax
Pass a long tick count. The constants on TimeSpan help.
C#
DateTime dt = new DateTime(2026, 11, 18, 14, 30, 45);
DateTime a = dt.AddTicks(TimeSpan.TicksPerSecond * 5); // +5 s
DateTime b = dt.AddTicks(1); // smallest step
DateTime c = dt.AddTicks(-TimeSpan.TicksPerMinute); // back 1 min
Call
What it does
dt.AddTicks(TimeSpan.TicksPerSecond * 5)
Five seconds later.
dt.AddTicks(1)
The smallest possible step (100 ns).
dt.AddTicks(-TimeSpan.TicksPerMinute)
One minute earlier.
There are 10,000,000 ticks in a second. TimeSpan.TicksPerMillisecond, TicksPerSecond, TicksPerMinute, TicksPerHour, and TicksPerDay avoid magic numbers.
Library declarations
C#
public DateTime AddTicks(long value);
Parameters
Parameter
Description
value
Required. Number of ticks to add as a long. Negative values go backward.
Return Value
Return Value
Description
DateTime
A new DateTime shifted by value ticks, with the same Kind.
C# Examples
Example 1 — Add Ticks Using a Constant
Add five seconds expressed as ticks.
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);
DateTime later = dt.AddTicks(TimeSpan.TicksPerSecond * 5);
Console.WriteLine(Show(later));
Console.WriteLine(TimeSpan.TicksPerSecond);
}
}
Output
2026-11-18 14:30:50
10000000
How It Works
Named constant.TicksPerSecond is 10,000,000, so five seconds is five times that.
Seconds moved. 14:30:45 plus 5 seconds shows 14:30:50.
Readable code. The constant explains the intent better than a long number.
Second line. It prints the constant itself so you can see the scale.
Example 2 — The Smallest Step
Add a single tick and show it with seven fraction digits.
C#
using System;
using System.Globalization;
class Program {
static void Main() {
DateTime start = new DateTime(2026, 11, 18, 0, 0, 0);
DateTime next = start.AddTicks(1);
Console.WriteLine(next.Ticks - start.Ticks);
Console.WriteLine(start.AddTicks(5000).ToString("ss.fffffff", CultureInfo.InvariantCulture));
}
}
Output
1
00.0005000
How It Works
One tick. The smallest change a DateTime can represent is 1.
Subtract Ticks. The difference of the two Ticks values is exactly 1.
5000 ticks. That is 0.5 milliseconds, or 500 microseconds.
fffffff. Seven f letters print all seven fraction digits: 0005000.
Example 3 — Compare with AddMilliseconds
Check that ticks and milliseconds agree and read the ticks in a day.
C#
using System;
class Program {
static void Main() {
DateTime dt = new DateTime(2026, 11, 18, 14, 30, 45);
Console.WriteLine(TimeSpan.TicksPerMillisecond);
Console.WriteLine(TimeSpan.TicksPerDay);
Console.WriteLine(dt.AddTicks(TimeSpan.TicksPerMillisecond * 250) == dt.AddMilliseconds(250));
}
}
Output
10000
864000000000
True
How It Works
Per millisecond. There are 10,000 ticks in one millisecond.
Per day. A day has 864,000,000,000 ticks (86,400 seconds times 10 million).
Same instant. 250 ms as ticks lands on the same value as AddMilliseconds(250).
Prints True. Both routes end at an identical tick count.
Frequently Asked Questions
A tick is 100 nanoseconds. There are 10,000,000 ticks in one second.
There are 864,000,000,000 ticks in a day (TimeSpan.TicksPerDay).
Use it for the finest step or when your data is already a tick count. Otherwise AddSeconds or AddDays reads better.
Yes. It moves the time earlier.
It returns the number of ticks since January 1, year 1 at 00:00:00.