DateTime.AddMicroseconds(Double) Method

Definition

Returns a new DateTime that adds the specified number of microseconds to the value of this instance.

C#
public DateTime AddMicroseconds(double value);

Parameters

value
Double

A number of whole and fractional microseconds. The value parameter can be negative or positive. Note that this value is rounded to the nearest integer.

Returns

An object whose value is the sum of the date and time represented by this instance and the number of microseconds represented by value.

Exceptions

The resulting DateTime is less than MinValue or greater than MaxValue.

Remarks

This method does not change the value of this DateTime. Instead, it returns a new DateTime whose value is the result of this operation.

The fractional part of value is the fractional part of a microsecond. For example, 4.5 is equivalent to 4 microseconds and 50 ticks, where one microsecond = 10 ticks.

The value parameter is rounded to the nearest integer.

Applies to

Product Versions
.NET 7, 8, 9, 10